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/paged_searches.c | |
parent | c13ae707313c5bf9819a75c1699d099565d2494d (diff) | |
download | samba-5a1433cae7bafe01371663aed8520ce29175cac7.tar.gz samba-5a1433cae7bafe01371663aed8520ce29175cac7.tar.bz2 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/paged_searches.c')
-rw-r--r-- | source4/lib/ldb/modules/paged_searches.c | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/source4/lib/ldb/modules/paged_searches.c b/source4/lib/ldb/modules/paged_searches.c index 749858b49b..fd580a3c4a 100644 --- a/source4/lib/ldb/modules/paged_searches.c +++ b/source4/lib/ldb/modules/paged_searches.c @@ -312,7 +312,7 @@ static int ps_continuation(struct ldb_handle *handle) return ldb_next_request(handle->module, ac->new_req); } -static int ps_wait_none(struct ldb_handle *handle) +static int ps_wait_once(struct ldb_handle *handle) { struct ps_context *ac; int ret; @@ -365,27 +365,25 @@ done: return ret; } -static int ps_wait_all(struct ldb_handle *handle) +static int ps_wait(struct ldb_handle *handle, enum ldb_wait_type type) { int ret; - while (handle->state != LDB_ASYNC_DONE) { - ret = ps_wait_none(handle); - if (ret != LDB_SUCCESS) { - return ret; - } + if (!handle || !handle->private_data) { + return LDB_ERR_OPERATIONS_ERROR; } - return handle->status; -} - -static int ps_wait(struct ldb_handle *handle, enum ldb_wait_type type) -{ if (type == LDB_WAIT_ALL) { - return ps_wait_all(handle); - } else { - return ps_wait_none(handle); + while (handle->state != LDB_ASYNC_DONE) { + ret = ps_wait_once(handle); + if (ret != LDB_SUCCESS) { + return ret; + } + } + + return handle->status; } + return ps_wait_once(handle); } static int check_supported_paged(struct ldb_context *ldb, void *context, |