summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/ldb_tdb/ldb_search.c
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2006-05-28 02:10:44 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:08:39 -0500
commit90a5e19e03842b77fd7811965fb2603e552261bc (patch)
tree211bda772b224b6cfdc54e5b3fc1857fc539d9dd /source4/lib/ldb/ldb_tdb/ldb_search.c
parent53107aed4a45f28aa1a159019ff4c3b45fbc8f02 (diff)
downloadsamba-90a5e19e03842b77fd7811965fb2603e552261bc.tar.gz
samba-90a5e19e03842b77fd7811965fb2603e552261bc.tar.bz2
samba-90a5e19e03842b77fd7811965fb2603e552261bc.zip
r15913: Error passing in the async code is not in agood shape
Start enhancing it and fix some problems with incorrect evalutaion of the codes Implement rdn rename (async only) (This used to be commit 6af1d738b9668d4f0eb6194ac0f84af9e73f8c2e)
Diffstat (limited to 'source4/lib/ldb/ldb_tdb/ldb_search.c')
-rw-r--r--source4/lib/ldb/ldb_tdb/ldb_search.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/source4/lib/ldb/ldb_tdb/ldb_search.c b/source4/lib/ldb/ldb_tdb/ldb_search.c
index 7e14a3000a..0ab1442c2f 100644
--- a/source4/lib/ldb/ldb_tdb/ldb_search.c
+++ b/source4/lib/ldb/ldb_tdb/ldb_search.c
@@ -462,15 +462,12 @@ static int ltdb_search_full(struct ldb_async_handle *handle)
ret = tdb_traverse_read(ltdb->tdb, search_func, handle);
- handle->state = LDB_ASYNC_DONE;
-
if (ret == -1) {
handle->status = LDB_ERR_OPERATIONS_ERROR;
- return handle->status;
}
- handle->status = LDB_SUCCESS;
- return handle->status;
+ handle->state = LDB_ASYNC_DONE;
+ return LDB_SUCCESS;
}
static int ltdb_search_sync_callback(struct ldb_context *ldb, void *context, struct ldb_async_result *ares)
@@ -548,7 +545,6 @@ int ltdb_search_async(struct ldb_module *module, const struct ldb_dn *base,
*handle = init_ltdb_handle(ltdb, module, context, callback);
if (*handle == NULL) {
- talloc_free(*handle);
ltdb_unlock_read(module);
return LDB_ERR_OPERATIONS_ERROR;
}
@@ -566,13 +562,13 @@ int ltdb_search_async(struct ldb_module *module, const struct ldb_dn *base,
}
if (ret != LDB_SUCCESS) {
ldb_set_errstring(module->ldb, talloc_strdup(module->ldb, "Indexed and full searches both failed!\n"));
- talloc_free(*handle);
- *handle = NULL;
+ (*handle)->state = LDB_ASYNC_DONE;
+ (*handle)->status = ret;
}
ltdb_unlock_read(module);
- return ret;
+ return LDB_SUCCESS;
}
/*