X-Git-Url: https://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Ftdb2%2Ftdb.c;fp=ccan%2Ftdb2%2Ftdb.c;h=57b0777845e78805ff56298fd10517b4c8f351cb;hp=9f3da1c01ff3363663cb14c4c6cca430367a0faa;hb=acb26c9c3ee054c8b2141db25c9bd7be064e425c;hpb=8bc38cb177928ef739440c32e33a8eaf23a5dd22 diff --git a/ccan/tdb2/tdb.c b/ccan/tdb2/tdb.c index 9f3da1c0..57b07778 100644 --- a/ccan/tdb2/tdb.c +++ b/ccan/tdb2/tdb.c @@ -302,6 +302,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;