summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2011-03-04 20:51:07 +0100
committerMatthias Dieter Wallnöfer <mdw@samba.org>2011-03-04 22:51:57 +0100
commit75706a627d0a54713f524cede1d7c72e5ff41cb4 (patch)
tree2e0d5ba06212c7a7862a739a84846441bb4980aa /source4
parentdabed32ffe631a334a126fec472f71e628032025 (diff)
downloadsamba-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')
-rw-r--r--source4/lib/ldb/common/ldb_msg.c7
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);
}