summaryrefslogtreecommitdiff
path: root/lib/tdb2/traverse.c
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2011-09-14 08:02:13 +0930
committerRusty Russell <rusty@rustcorp.com.au>2011-09-14 08:02:13 +0930
commita347a4802695c41437e2966404d1e2fe2dee78b4 (patch)
tree1dfc2d321511aff0d3ecbd09a955024fd51dafb1 /lib/tdb2/traverse.c
parent662f46de21437527a57f0cfc77e290a3ec9f3d94 (diff)
downloadsamba-a347a4802695c41437e2966404d1e2fe2dee78b4.tar.gz
samba-a347a4802695c41437e2966404d1e2fe2dee78b4.tar.bz2
samba-a347a4802695c41437e2966404d1e2fe2dee78b4.zip
tdb2: unify tdb1_wipe into tdb_wipe.
Switch on the TDB_VERSION1 flag. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (Imported from CCAN commit b2555a868e3ee58d1b31f9558e3623d49ed2b2f1)
Diffstat (limited to 'lib/tdb2/traverse.c')
-rw-r--r--lib/tdb2/traverse.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/tdb2/traverse.c b/lib/tdb2/traverse.c
index b27550032f..b1897ce1b8 100644
--- a/lib/tdb2/traverse.c
+++ b/lib/tdb2/traverse.c
@@ -115,6 +115,12 @@ enum TDB_ERROR tdb_wipe_all(struct tdb_context *tdb)
enum TDB_ERROR ecode;
int64_t count;
+ if (tdb->flags & TDB_VERSION1) {
+ if (tdb1_wipe_all(tdb) == -1)
+ return tdb->last_error;
+ return TDB_SUCCESS;
+ }
+
ecode = tdb_allrecord_lock(tdb, F_WRLCK, TDB_LOCK_WAIT, false);
if (ecode != TDB_SUCCESS)
return tdb->last_error = ecode;