From 89144dfeade7d96527ebe5321ee0328662d81afd Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 5 Dec 2007 01:25:07 +0100 Subject: 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) --- source4/lib/ldb/common/ldb_modules.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) (limited to 'source4/lib/ldb/common') 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) -- cgit