diff options
| author | Simo Sorce <idra@samba.org> | 2007-12-24 01:38:37 -0600 |
|---|---|---|
| committer | Stefan Metzmacher <metze@samba.org> | 2007-12-24 01:51:07 -0600 |
| commit | 5a1433cae7bafe01371663aed8520ce29175cac7 (patch) | |
| tree | a0bd3864fa5435e71e034bc7777fc85af5c3f3ed /source4/lib/ldb/modules/asq.c | |
| parent | c13ae707313c5bf9819a75c1699d099565d2494d (diff) | |
| download | samba-5a1433cae7bafe01371663aed8520ce29175cac7.tar.gz samba-5a1433cae7bafe01371663aed8520ce29175cac7.tar.xz samba-5a1433cae7bafe01371663aed8520ce29175cac7.zip | |
r26581: Make ldb_wait uniform, so that it is easy to remove it completely from modules
later on.
(This used to be commit f75ce8c20aa2b466e9ee86fdf1702b2ffda10ddf)
Diffstat (limited to 'source4/lib/ldb/modules/asq.c')
| -rw-r--r-- | source4/lib/ldb/modules/asq.c | 27 |
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) |
