summaryrefslogtreecommitdiff
path: root/source3/lib/dbwrap_tdb.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib/dbwrap_tdb.c')
-rw-r--r--source3/lib/dbwrap_tdb.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/source3/lib/dbwrap_tdb.c b/source3/lib/dbwrap_tdb.c
index 238ba51761..2b09e3ccab 100644
--- a/source3/lib/dbwrap_tdb.c
+++ b/source3/lib/dbwrap_tdb.c
@@ -127,9 +127,15 @@ static NTSTATUS db_tdb_delete(struct db_record *rec)
{
struct db_tdb_ctx *ctx = talloc_get_type_abort(rec->private_data,
struct db_tdb_ctx);
+ int res;
+
+ res = tdb_delete(ctx->tdb, rec->key);
- return (tdb_delete(ctx->tdb, rec->key) == 0) ?
- NT_STATUS_OK : NT_STATUS_UNSUCCESSFUL;
+ if (res == 0) {
+ return NT_STATUS_OK;
+ }
+
+ return map_nt_error_from_tdb(tdb_error(ctx->tdb));
}
struct db_tdb_traverse_ctx {