summaryrefslogtreecommitdiff
path: root/source4/lib/ldb
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2011-02-01 20:37:58 +0100
committerMatthias Dieter Wallnöfer <mdw@samba.org>2011-02-09 18:59:19 +0100
commit2937e636442984103b6c85de98203c31fe143032 (patch)
tree78a08aacfb3a533c2580ab6c8119bd9a31c87552 /source4/lib/ldb
parentde9217beaa7fba88273f3b0b7b05497280beb796 (diff)
downloadsamba-2937e636442984103b6c85de98203c31fe143032.tar.gz
samba-2937e636442984103b6c85de98203c31fe143032.tar.bz2
samba-2937e636442984103b6c85de98203c31fe143032.zip
ldb:ldbadd tool - use LDB return codes where possible
Diffstat (limited to 'source4/lib/ldb')
-rw-r--r--source4/lib/ldb/tools/ldbadd.c10
1 files changed, 6 insertions, 4 deletions
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);