diff options
author | Andrew Bartlett <abartlet@samba.org> | 2007-12-05 01:25:07 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2007-12-21 05:48:16 +0100 |
commit | 89144dfeade7d96527ebe5321ee0328662d81afd (patch) | |
tree | 35286f805a2406b19267699a2fcd5287f008f507 /source4/lib | |
parent | 7f015e2e2e39e5eaf08261b97df885590f109abc (diff) | |
download | samba-89144dfeade7d96527ebe5321ee0328662d81afd.tar.gz samba-89144dfeade7d96527ebe5321ee0328662d81afd.tar.bz2 samba-89144dfeade7d96527ebe5321ee0328662d81afd.zip |
r26301: Collapose ldb_next_init() into being a caller of ldb_init_module_chain
and therefore further improve debug output.
Andrew Bartlett
(This used to be commit 5e93ca2ea16a7d10d63606ae539c0fdc4e224556)
Diffstat (limited to 'source4/lib')
-rw-r--r-- | source4/lib/ldb/common/ldb_modules.c | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/source4/lib/ldb/common/ldb_modules.c b/source4/lib/ldb/common/ldb_modules.c index 82973a4149..508389e374 100644 --- a/source4/lib/ldb/common/ldb_modules.c +++ b/source4/lib/ldb/common/ldb_modules.c @@ -279,10 +279,15 @@ int ldb_init_module_chain(struct ldb_context *ldb, struct ldb_module *module) while (module && module->ops->init_context == NULL) module = module->next; - if (module && module->ops->init_context && - module->ops->init_context(module) != LDB_SUCCESS) { - ldb_debug(ldb, LDB_DEBUG_FATAL, "module %s initialization failed\n", module->ops->name); - return LDB_ERR_OPERATIONS_ERROR; + /* init is different in that it is not an error if modules + * do not require initialization */ + + if (module) { + int ret = module->ops->init_context(module); + if (ret != LDB_SUCCESS) { + ldb_debug(ldb, LDB_DEBUG_FATAL, "module %s initialization failed\n", module->ops->name); + return ret; + } } return LDB_SUCCESS; @@ -434,18 +439,9 @@ int ldb_next_request(struct ldb_module *module, struct ldb_request *request) int ldb_next_init(struct ldb_module *module) { - /* init is different in that it is not an error if modules - * do not require initialization */ - module = module->next; - while (module && module->ops->init_context == NULL) - module = module->next; - - if (module == NULL) - return LDB_SUCCESS; - - return module->ops->init_context(module); + return ldb_init_module_chain(module->ldb, module); } int ldb_next_start_trans(struct ldb_module *module) |