git.samba.org
/
nivanova
/
samba-autobuild
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b5cd038
)
Return NOTFOUND from db_tdb_delete if the record does not exist
author
Volker Lendecke
<vl@samba.org>
Thu, 24 Jan 2008 18:06:25 +0000
(19:06 +0100)
committer
Volker Lendecke
<vl@samba.org>
Sat, 2 Feb 2008 10:03:21 +0000
(11:03 +0100)
(This used to be commit
1ff924c4360952eb1d714a2f2ec3760b380c7a24
)
source3/lib/dbwrap_tdb.c
patch
|
blob
|
history
diff --git
a/source3/lib/dbwrap_tdb.c
b/source3/lib/dbwrap_tdb.c
index 18f94959315e4357e3cd032b81b1fcb08ccbc6e9..da55049e52f9e09e7f0ae58e293dd74544d99b37 100644
(file)
--- a/
source3/lib/dbwrap_tdb.c
+++ b/
source3/lib/dbwrap_tdb.c
@@
-196,8
+196,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);
- return (tdb_delete(ctx->wtdb->tdb, rec->key) == 0) ?
- NT_STATUS_OK : NT_STATUS_UNSUCCESSFUL;
+ if (tdb_delete(ctx->wtdb->tdb, rec->key) == 0) {
+ return NT_STATUS_OK;
+ }
+
+ if (tdb_error(ctx->wtdb->tdb) == TDB_ERR_NOEXIST) {
+ return NT_STATUS_NOT_FOUND;
+ }
+
+ return NT_STATUS_UNSUCCESSFUL;
}
struct db_tdb_traverse_ctx {