summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/common
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2006-03-03 20:01:19 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:52:13 -0500
commit509814bd037a3c73fea4ab92b531c25964f34dfa (patch)
treed872537971ca08cf87c1cd3147009c0aa3c18c17 /source4/lib/ldb/common
parent6ef61825541131e16a03975cdbd344e2bbebf810 (diff)
downloadsamba-509814bd037a3c73fea4ab92b531c25964f34dfa.tar.gz
samba-509814bd037a3c73fea4ab92b531c25964f34dfa.tar.bz2
samba-509814bd037a3c73fea4ab92b531c25964f34dfa.zip
r13823: make async_wait part of the modules ops
(This used to be commit b4202cf030d5f154f0f94f5f501ecd648ba5c48f)
Diffstat (limited to 'source4/lib/ldb/common')
-rw-r--r--source4/lib/ldb/common/ldb.c9
-rw-r--r--source4/lib/ldb/common/ldb_modules.c8
2 files changed, 12 insertions, 5 deletions
diff --git a/source4/lib/ldb/common/ldb.c b/source4/lib/ldb/common/ldb.c
index 28bed0b0ea..9d8783324c 100644
--- a/source4/lib/ldb/common/ldb.c
+++ b/source4/lib/ldb/common/ldb.c
@@ -125,7 +125,7 @@ void ldb_reset_err_string(struct ldb_context *ldb)
#define FIRST_OP(ldb, op) do { \
module = ldb->modules; \
while (module && module->ops->op == NULL) module = module->next; \
- if (module == NULL) return -1; \
+ if (module == NULL) return LDB_ERR_OPERATIONS_ERROR; \
} while (0)
/*
@@ -208,10 +208,11 @@ int ldb_transaction_cancel(struct ldb_context *ldb)
int ldb_async_wait(struct ldb_context *ldb, struct ldb_async_handle *handle, enum ldb_async_wait_type type)
{
- if (ldb->async_wait != NULL)
- return ldb->async_wait(handle, type);
+ struct ldb_module *module;
+
+ FIRST_OP(ldb, async_wait);
- return LDB_ERR_OPERATIONS_ERROR;
+ return module->ops->async_wait(module, handle, type);
}
/*
diff --git a/source4/lib/ldb/common/ldb_modules.c b/source4/lib/ldb/common/ldb_modules.c
index f1b4783fca..17c5231e54 100644
--- a/source4/lib/ldb/common/ldb_modules.c
+++ b/source4/lib/ldb/common/ldb_modules.c
@@ -278,7 +278,7 @@ int ldb_load_modules(struct ldb_context *ldb, const char *options[])
#define FIND_OP(module, op) do { \
module = module->next; \
while (module && module->ops->op == NULL) module = module->next; \
- if (module == NULL) return LDB_ERR_OTHER; \
+ if (module == NULL) return LDB_ERR_OPERATIONS_ERROR; \
} while (0)
@@ -324,3 +324,9 @@ int ldb_next_del_trans(struct ldb_module *module)
FIND_OP(module, del_transaction);
return module->ops->del_transaction(module);
}
+
+int ldb_next_async_wait(struct ldb_module *module, struct ldb_async_handle *handle, enum ldb_async_wait_type type)
+{
+ FIND_OP(module, async_wait);
+ return module->ops->async_wait(module, handle, type);
+}