diff options
author | Matthias Dieter Wallnöfer <mdw@samba.org> | 2011-03-04 20:51:07 +0100 |
---|---|---|
committer | Matthias Dieter Wallnöfer <mdw@samba.org> | 2011-03-04 22:51:57 +0100 |
commit | 75706a627d0a54713f524cede1d7c72e5ff41cb4 (patch) | |
tree | 2e0d5ba06212c7a7862a739a84846441bb4980aa /source4/lib/ldb/common/ldb_msg.c | |
parent | dabed32ffe631a334a126fec472f71e628032025 (diff) | |
download | samba-75706a627d0a54713f524cede1d7c72e5ff41cb4.tar.gz samba-75706a627d0a54713f524cede1d7c72e5ff41cb4.tar.bz2 samba-75706a627d0a54713f524cede1d7c72e5ff41cb4.zip |
ldb:ldb_msg.c - use LDB result constants for checking return values
Reviewed by: Tridge
Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org>
Autobuild-Date: Fri Mar 4 22:51:57 CET 2011 on sn-devel-104
Diffstat (limited to 'source4/lib/ldb/common/ldb_msg.c')
-rw-r--r-- | source4/lib/ldb/common/ldb_msg.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source4/lib/ldb/common/ldb_msg.c b/source4/lib/ldb/common/ldb_msg.c index 8b51ad087c..d1c77f89bc 100644 --- a/source4/lib/ldb/common/ldb_msg.c +++ b/source4/lib/ldb/common/ldb_msg.c @@ -890,11 +890,14 @@ int ldb_msg_rename_attr(struct ldb_message *msg, const char *attr, const char *r int ldb_msg_copy_attr(struct ldb_message *msg, const char *attr, const char *replace) { struct ldb_message_element *el = ldb_msg_find_element(msg, attr); + int ret; + if (el == NULL) { return LDB_SUCCESS; } - if (ldb_msg_add(msg, el, 0) != 0) { - return LDB_ERR_OPERATIONS_ERROR; + ret = ldb_msg_add(msg, el, 0); + if (ret != LDB_SUCCESS) { + return ret; } return ldb_msg_rename_attr(msg, attr, replace); } |