diff options
author | Simo Sorce <idra@samba.org> | 2008-06-14 11:24:17 -0400 |
---|---|---|
committer | Simo Sorce <idra@samba.org> | 2008-06-14 11:59:19 -0400 |
commit | 929adc9efa5cf985f0585214d30d18521aa1a821 (patch) | |
tree | 2a0f3e4dedc1336fb29aa4f36f302f29c5439f55 /source4/lib/ldb_wrap.c | |
parent | 2aba4107915611b223daa8c27c52352f57b25bbc (diff) | |
download | samba-929adc9efa5cf985f0585214d30d18521aa1a821.tar.gz samba-929adc9efa5cf985f0585214d30d18521aa1a821.tar.bz2 samba-929adc9efa5cf985f0585214d30d18521aa1a821.zip |
Make up the right dependencies now that ldb depends on libevents
(This used to be commit 3b8eec7ca334528cad3cdcd5e3fc5ee555d8d0e0)
Diffstat (limited to 'source4/lib/ldb_wrap.c')
-rw-r--r-- | source4/lib/ldb_wrap.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/source4/lib/ldb_wrap.c b/source4/lib/ldb_wrap.c index f47d0d5d39..883597108a 100644 --- a/source4/lib/ldb_wrap.c +++ b/source4/lib/ldb_wrap.c @@ -107,22 +107,31 @@ struct ldb_context *ldb_wrap_connect(TALLOC_CTX *mem_ctx, char *real_url = NULL; size_t *startup_blocks; - ldb = ldb_init(mem_ctx); - if (ldb == NULL) { + /* we want to use the existing event context if possible. This + relies on the fact that in smbd, everything is a child of + the main event_context */ + if (ev == NULL) { return NULL; } - ldb_set_modules_dir(ldb, - talloc_asprintf(ldb, "%s/ldb", lp_modulesdir(lp_ctx))); - - if (ev == NULL) { + ldb = ldb_init(mem_ctx, ev); + if (ldb == NULL) { return NULL; } - if (ldb_set_opaque(ldb, "EventContext", ev)) { + ldb_set_modules_dir(ldb, + talloc_asprintf(ldb, + "%s/ldb", + lp_modulesdir(lp_ctx))); + +#if 0 + if (ev) { + ldb_event_sys_op_init(ldb, ev); + } else { talloc_free(ldb); return NULL; } +#endif if (ldb_set_opaque(ldb, "sessionInfo", session_info)) { talloc_free(ldb); |