summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/lib/dbwrap_tdb.c3
-rw-r--r--source3/lib/gencache.c16
-rw-r--r--source3/lib/util_tdb.c8
-rw-r--r--source4/lib/ldb/ldb_tdb/ldb_tdb.c5
4 files changed, 10 insertions, 22 deletions
diff --git a/source3/lib/dbwrap_tdb.c b/source3/lib/dbwrap_tdb.c
index fc2af28c83..2ed368ee97 100644
--- a/source3/lib/dbwrap_tdb.c
+++ b/source3/lib/dbwrap_tdb.c
@@ -330,7 +330,8 @@ static int db_tdb_transaction_cancel(struct db_context *db)
{
struct db_tdb_ctx *db_ctx =
talloc_get_type_abort(db->private_data, struct db_tdb_ctx);
- return tdb_transaction_cancel(db_ctx->wtdb->tdb);
+ tdb_transaction_cancel(db_ctx->wtdb->tdb);
+ return 0;
}
struct db_context *db_open_tdb(TALLOC_CTX *mem_ctx,
diff --git a/source3/lib/gencache.c b/source3/lib/gencache.c
index 62bad96fbb..ab7de21d92 100644
--- a/source3/lib/gencache.c
+++ b/source3/lib/gencache.c
@@ -489,18 +489,14 @@ bool gencache_stabilize(void)
res = tdb_traverse(cache_notrans, stabilize_fn, &state);
if ((res == -1) || state.error) {
- if ((tdb_transaction_cancel(cache_notrans) == -1)
- || (tdb_transaction_cancel(cache) == -1)) {
- smb_panic("tdb_transaction_cancel failed\n");
- }
+ tdb_transaction_cancel(cache_notrans);
+ tdb_transaction_cancel(cache);
return false;
}
if (!state.written) {
- if ((tdb_transaction_cancel(cache_notrans) == -1)
- || (tdb_transaction_cancel(cache) == -1)) {
- smb_panic("tdb_transaction_cancel failed\n");
- }
+ tdb_transaction_cancel(cache_notrans);
+ tdb_transaction_cancel(cache);
return true;
}
@@ -508,9 +504,7 @@ bool gencache_stabilize(void)
if (res != 0) {
DEBUG(10, ("tdb_transaction_commit on gencache.tdb failed: "
"%s\n", tdb_errorstr(cache)));
- if (tdb_transaction_cancel(cache_notrans) == -1) {
- smb_panic("tdb_transaction_cancel failed\n");
- }
+ tdb_transaction_cancel(cache_notrans);
return false;
}
diff --git a/source3/lib/util_tdb.c b/source3/lib/util_tdb.c
index 5c3dc3a07d..f0fc8cd29b 100644
--- a/source3/lib/util_tdb.c
+++ b/source3/lib/util_tdb.c
@@ -442,9 +442,7 @@ int tdb_trans_store(struct tdb_context *tdb, TDB_DATA key, TDB_DATA dbuf,
if ((res = tdb_store(tdb, key, dbuf, flag)) != 0) {
DEBUG(10, ("tdb_store failed\n"));
- if (tdb_transaction_cancel(tdb) != 0) {
- smb_panic("Cancelling transaction failed");
- }
+ tdb_transaction_cancel(tdb);
return res;
}
@@ -471,9 +469,7 @@ int tdb_trans_delete(struct tdb_context *tdb, TDB_DATA key)
if ((res = tdb_delete(tdb, key)) != 0) {
DEBUG(10, ("tdb_delete failed\n"));
- if (tdb_transaction_cancel(tdb) != 0) {
- smb_panic("Cancelling transaction failed");
- }
+ tdb_transaction_cancel(tdb);
return res;
}
diff --git a/source4/lib/ldb/ldb_tdb/ldb_tdb.c b/source4/lib/ldb/ldb_tdb/ldb_tdb.c
index 436ef46b33..77b4b24a2e 100644
--- a/source4/lib/ldb/ldb_tdb/ldb_tdb.c
+++ b/source4/lib/ldb/ldb_tdb/ldb_tdb.c
@@ -1073,10 +1073,7 @@ static int ltdb_del_trans(struct ldb_module *module)
return ltdb_err_map(tdb_error(ltdb->tdb));
}
- if (tdb_transaction_cancel(ltdb->tdb) != 0) {
- return ltdb_err_map(tdb_error(ltdb->tdb));
- }
-
+ tdb_transaction_cancel(ltdb->tdb);
return LDB_SUCCESS;
}