diff options
author | Volker Lendecke <vl@samba.org> | 2014-03-27 10:42:34 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2014-03-31 22:52:14 +0200 |
commit | cb435fd493823fcfb300e4a293d8739fe365fe40 (patch) | |
tree | 159917091aeeedbc9a1385a8cd685a6ad379c22c /source4/lib | |
parent | 1f43a4ccaf81eb787b68b185d58728b8af211557 (diff) | |
download | samba-cb435fd493823fcfb300e4a293d8739fe365fe40.tar.gz samba-cb435fd493823fcfb300e4a293d8739fe365fe40.tar.xz samba-cb435fd493823fcfb300e4a293d8739fe365fe40.zip |
messaging4: Simplify irpc_namedb_open a bit
It does not really need the msg_ctx, and it also removes the implicit talloc
hierarchy.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source4/lib')
-rw-r--r-- | source4/lib/messaging/messaging.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source4/lib/messaging/messaging.c b/source4/lib/messaging/messaging.c index fbdfd95d910..c33aae34969 100644 --- a/source4/lib/messaging/messaging.c +++ b/source4/lib/messaging/messaging.c @@ -39,7 +39,7 @@ /* change the message version with any incompatible changes in the protocol */ #define IMESSAGING_VERSION 1 -static struct tdb_wrap *irpc_namedb_open(struct imessaging_context *msg_ctx, +static struct tdb_wrap *irpc_namedb_open(TALLOC_CTX *mem_ctx, const char *base_path, struct loadparm_context *lp_ctx); /* @@ -626,7 +626,7 @@ struct imessaging_context *imessaging_init(TALLOC_CTX *mem_ctx, msg->start_time = timeval_current(); - msg->names_db = irpc_namedb_open(msg, lp_ctx); + msg->names_db = irpc_namedb_open(msg, msg->base_path, lp_ctx); if (msg->names_db == NULL) { goto fail; } @@ -907,15 +907,15 @@ static int irpc_destructor(struct irpc_request *irpc) /* open the naming database */ -static struct tdb_wrap *irpc_namedb_open(struct imessaging_context *msg_ctx, +static struct tdb_wrap *irpc_namedb_open(TALLOC_CTX *mem_ctx, const char *base_path, struct loadparm_context *lp_ctx) { struct tdb_wrap *t; - char *path = talloc_asprintf(msg_ctx, "%s/names.tdb", msg_ctx->base_path); + char *path = talloc_asprintf(mem_ctx, "%s/names.tdb", base_path); if (path == NULL) { return NULL; } - t = tdb_wrap_open(msg_ctx, path, lpcfg_tdb_hash_size(lp_ctx, path), + t = tdb_wrap_open(mem_ctx, path, lpcfg_tdb_hash_size(lp_ctx, path), lpcfg_tdb_flags(lp_ctx, 0), O_RDWR|O_CREAT, 0660); talloc_free(path); return t; |