From 2937e636442984103b6c85de98203c31fe143032 Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Tue, 1 Feb 2011 20:37:58 +0100 Subject: ldb:ldbadd tool - use LDB return codes where possible --- source4/lib/ldb/tools/ldbadd.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'source4/lib/ldb') diff --git a/source4/lib/ldb/tools/ldbadd.c b/source4/lib/ldb/tools/ldbadd.c index 82eb358330..464b14393c 100644 --- a/source4/lib/ldb/tools/ldbadd.c +++ b/source4/lib/ldb/tools/ldbadd.c @@ -109,9 +109,10 @@ int main(int argc, const char **argv) options = ldb_cmdline_process(ldb, argc, argv, usage); - if (ldb_transaction_start(ldb) != LDB_SUCCESS) { + ret = ldb_transaction_start(ldb); + if (ret != LDB_SUCCESS) { printf("Failed to start transaction: %s\n", ldb_errstring(ldb)); - exit(1); + return ret; } if (options->argc == 0) { @@ -131,9 +132,10 @@ int main(int argc, const char **argv) } if (count != 0) { - if (ldb_transaction_commit(ldb) != LDB_SUCCESS) { + ret = ldb_transaction_commit(ldb); + if (ret != LDB_SUCCESS) { printf("Failed to commit transaction: %s\n", ldb_errstring(ldb)); - exit(1); + return ret; } } else { ldb_transaction_cancel(ldb); -- cgit