summaryrefslogtreecommitdiff
path: root/source3/lib/dbwrap_tdb.c
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2007-05-28 11:08:58 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:22:51 -0500
commit7e27c984c4033d4f3cbeec9c18627ef9d8aa5f90 (patch)
treecde9a3938d4d96cc86051f67fd1982cc44623b05 /source3/lib/dbwrap_tdb.c
parent8c57860cc79f37296785b4f7ae67fd5a8a543e39 (diff)
downloadsamba-7e27c984c4033d4f3cbeec9c18627ef9d8aa5f90.tar.gz
samba-7e27c984c4033d4f3cbeec9c18627ef9d8aa5f90.tar.bz2
samba-7e27c984c4033d4f3cbeec9c18627ef9d8aa5f90.zip
r23170: Add map_nt_error_from_tdb()
(This used to be commit 02beae81c8ecef7cfe300a29852d74813c9409bf)
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 {