summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/modules/asq.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/lib/ldb/modules/asq.c')
-rw-r--r--source4/lib/ldb/modules/asq.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/source4/lib/ldb/modules/asq.c b/source4/lib/ldb/modules/asq.c
index c0d6a7c18c..b6a8594166 100644
--- a/source4/lib/ldb/modules/asq.c
+++ b/source4/lib/ldb/modules/asq.c
@@ -429,27 +429,26 @@ static int asq_search(struct ldb_module *module, struct ldb_request *req)
return asq_search_continue(h);
}
-static int asq_wait_all(struct ldb_handle *handle)
+static int asq_wait(struct ldb_handle *handle, enum ldb_wait_type type)
{
int ret;
- while (handle->state != LDB_ASYNC_DONE) {
- ret = asq_search_continue(handle);
- if (ret != LDB_SUCCESS) {
- return ret;
- }
+ if (!handle || !handle->private_data) {
+ return LDB_ERR_OPERATIONS_ERROR;
}
- return handle->status;
-}
-
-static int asq_wait(struct ldb_handle *handle, enum ldb_wait_type type)
-{
if (type == LDB_WAIT_ALL) {
- return asq_wait_all(handle);
- } else {
- return asq_search_continue(handle);
+ while (handle->state != LDB_ASYNC_DONE) {
+ ret = asq_search_continue(handle);
+ if (ret != LDB_SUCCESS) {
+ return ret;
+ }
+ }
+
+ return handle->status;
}
+
+ return asq_search_continue(handle);
}
static int asq_init(struct ldb_module *module)