From 7b9a4a89cb92a0281d73a2c2e79f5eeb317e1149 Mon Sep 17 00:00:00 2001 From: Fabiano FidĂȘncio Date: Wed, 25 May 2016 21:40:28 +0200 Subject: sysdb: move add_ulong() 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_ulong() 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 81223ad74..926994d3a 100644 --- a/src/db/sysdb.c +++ b/src/db/sysdb.c @@ -2142,3 +2142,16 @@ int sysdb_delete_string(struct ldb_message *msg, { return sysdb_ldb_msg_string_helper(msg, LDB_FLAG_MOD_DELETE, attr, value); } + +int add_ulong(struct ldb_message *msg, int flags, + const char *attr, unsigned long value) +{ + int ret; + + ret = ldb_msg_add_empty(msg, attr, flags, NULL); + if (ret == LDB_SUCCESS) { + ret = ldb_msg_add_fmt(msg, attr, "%lu", value); + if (ret == LDB_SUCCESS) return EOK; + } + return ENOMEM; +} diff --git a/src/db/sysdb_ops.c b/src/db/sysdb_ops.c index 62378b39c..39489a465 100644 --- a/src/db/sysdb_ops.c +++ b/src/db/sysdb_ops.c @@ -27,19 +27,6 @@ #include "util/cert.h" #include -int add_ulong(struct ldb_message *msg, int flags, - const char *attr, unsigned long value) -{ - int ret; - - ret = ldb_msg_add_empty(msg, attr, flags, NULL); - if (ret == LDB_SUCCESS) { - ret = ldb_msg_add_fmt(msg, attr, "%lu", value); - if (ret == LDB_SUCCESS) return EOK; - } - return ENOMEM; -} - static uint32_t get_attr_as_uint32(struct ldb_message *msg, const char *attr) { const struct ldb_val *v = ldb_msg_find_ldb_val(msg, attr); -- cgit