summaryrefslogtreecommitdiff
path: root/source4/lib/ldb
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2011-02-01 20:48:52 +0100
committerMatthias Dieter Wallnöfer <mdw@samba.org>2011-02-09 18:59:19 +0100
commit22f4030c303224ecc7ee28b0b93d80d27869a4a0 (patch)
tree7939882b57006a7a5b71cdfd54e1ae38b867dcf5 /source4/lib/ldb
parent23c0ae74523c5d35e0c9b41d6a7381a72bb7f6ec (diff)
downloadsamba-22f4030c303224ecc7ee28b0b93d80d27869a4a0.tar.gz
samba-22f4030c303224ecc7ee28b0b93d80d27869a4a0.tar.bz2
samba-22f4030c303224ecc7ee28b0b93d80d27869a4a0.zip
ldb:ldbsearch tool - use LDB result constants where possible
Diffstat (limited to 'source4/lib/ldb')
-rw-r--r--source4/lib/ldb/tools/ldbsearch.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/source4/lib/ldb/tools/ldbsearch.c b/source4/lib/ldb/tools/ldbsearch.c
index f68a4bf31d..10fab25a6a 100644
--- a/source4/lib/ldb/tools/ldbsearch.c
+++ b/source4/lib/ldb/tools/ldbsearch.c
@@ -194,14 +194,14 @@ static int do_search(struct ldb_context *ldb,
req = NULL;
sctx = talloc_zero(ldb, struct search_context);
- if (!sctx) return -1;
+ if (!sctx) return LDB_ERR_OPERATIONS_ERROR;
sctx->ldb = ldb;
sctx->sort = options->sorted;
sctx->req_ctrls = ldb_parse_control_strings(ldb, sctx, (const char **)options->controls);
if (options->controls != NULL && sctx->req_ctrls== NULL) {
printf("parsing controls failed: %s\n", ldb_errstring(ldb));
- return -1;
+ return LDB_ERR_OPERATIONS_ERROR;
}
if (basedn == NULL) {
@@ -221,7 +221,7 @@ again:
if (ret != LDB_SUCCESS) {
talloc_free(sctx);
printf("allocating request failed: %s\n", ldb_errstring(ldb));
- return -1;
+ return ret;
}
sctx->pending = 0;
@@ -229,13 +229,13 @@ again:
ret = ldb_request(ldb, req);
if (ret != LDB_SUCCESS) {
printf("search failed - %s\n", ldb_errstring(ldb));
- return -1;
+ return ret;
}
ret = ldb_wait(req->handle, LDB_WAIT_ALL);
- if (ret != LDB_SUCCESS) {
+ if (ret != LDB_SUCCESS) {
printf("search error - %s\n", ldb_errstring(ldb));
- return -1;
+ return ret;
}
if (sctx->pending)
@@ -262,7 +262,7 @@ again:
talloc_free(sctx);
talloc_free(req);
- return 0;
+ return LDB_SUCCESS;
}
int main(int argc, const char **argv)