From 5b1e73bc40a55f2095660423a2a4623a93de1ef8 Mon Sep 17 00:00:00 2001 From: Fabiano FidĂȘncio Date: Wed, 25 May 2016 20:16:58 +0200 Subject: sysdb: move add_string() convenience to sysdb.c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Considering that sysdb.c is about utilities around our cache and that sysdb_ops.c is about operations on objects, seems that add_string() could fit better in sysdb.c. This move is a suggestion from Jakub Hrozek. Related: https://fedorahosted.org/sssd/ticket/1656 Signed-off-by: Fabiano FidĂȘncio Reviewed-by: Petr Cech --- src/db/sysdb.c | 13 +++++++++++++ src/db/sysdb_ops.c | 13 ------------- 2 files changed, 13 insertions(+), 13 deletions(-) (limited to 'src/db') diff --git a/src/db/sysdb.c b/src/db/sysdb.c index d4366a3c7..f83d236c8 100644 --- a/src/db/sysdb.c +++ b/src/db/sysdb.c @@ -2111,3 +2111,16 @@ done: *_usn = usn; return EOK; } + +int add_string(struct ldb_message *msg, int flags, + const char *attr, const char *value) +{ + int ret; + + ret = ldb_msg_add_empty(msg, attr, flags, NULL); + if (ret == LDB_SUCCESS) { + ret = ldb_msg_add_string(msg, attr, value); + if (ret == LDB_SUCCESS) return EOK; + } + return ENOMEM; +} diff --git a/src/db/sysdb_ops.c b/src/db/sysdb_ops.c index 843251b3e..1a93956b0 100644 --- a/src/db/sysdb_ops.c +++ b/src/db/sysdb_ops.c @@ -27,19 +27,6 @@ #include "util/cert.h" #include -int add_string(struct ldb_message *msg, int flags, - const char *attr, const char *value) -{ - int ret; - - ret = ldb_msg_add_empty(msg, attr, flags, NULL); - if (ret == LDB_SUCCESS) { - ret = ldb_msg_add_string(msg, attr, value); - if (ret == LDB_SUCCESS) return EOK; - } - return ENOMEM; -} - int add_ulong(struct ldb_message *msg, int flags, const char *attr, unsigned long value) { -- cgit