summaryrefslogtreecommitdiff
path: root/lib/tdb2/tdb.c
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2011-09-14 07:53:13 +0930
committerRusty Russell <rusty@rustcorp.com.au>2011-09-14 07:53:13 +0930
commit10606b7e3bdad19a60953dbad9e1d541a1a3b805 (patch)
tree04179745d5fb006582a7284bcba5926f8ef1d89a /lib/tdb2/tdb.c
parent61095999cc158482f68fa53f16160033128615e8 (diff)
downloadsamba-10606b7e3bdad19a60953dbad9e1d541a1a3b805.tar.gz
samba-10606b7e3bdad19a60953dbad9e1d541a1a3b805.tar.bz2
samba-10606b7e3bdad19a60953dbad9e1d541a1a3b805.zip
tdb2: unify tdb1_delete into tdb_delete.
Switch on the TDB_VERSION1 flag. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (Imported from CCAN commit acb26c9c3ee054c8b2141db25c9bd7be064e425c)
Diffstat (limited to 'lib/tdb2/tdb.c')
-rw-r--r--lib/tdb2/tdb.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/tdb2/tdb.c b/lib/tdb2/tdb.c
index be2ff0d676..28d0e03f7d 100644
--- a/lib/tdb2/tdb.c
+++ b/lib/tdb2/tdb.c
@@ -304,6 +304,12 @@ enum TDB_ERROR tdb_delete(struct tdb_context *tdb, struct tdb_data key)
struct hash_info h;
enum TDB_ERROR ecode;
+ if (tdb->flags & TDB_VERSION1) {
+ if (tdb1_delete(tdb, key) == -1)
+ return tdb->last_error;
+ return TDB_SUCCESS;
+ }
+
off = find_and_lock(tdb, key, F_WRLCK, &h, &rec, NULL);
if (TDB_OFF_IS_ERR(off)) {
return tdb->last_error = off;