From 75706a627d0a54713f524cede1d7c72e5ff41cb4 Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Fri, 4 Mar 2011 20:51:07 +0100 Subject: ldb:ldb_msg.c - use LDB result constants for checking return values MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed by: Tridge Autobuild-User: Matthias Dieter Wallnöfer Autobuild-Date: Fri Mar 4 22:51:57 CET 2011 on sn-devel-104 --- source4/lib/ldb/common/ldb_msg.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'source4/lib/ldb/common') 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); } -- cgit