summaryrefslogtreecommitdiff
path: root/lib/tdb2/tdb.c
diff options
context:
space:
mode:
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 14bf059966..806fb037a4 100644
--- a/lib/tdb2/tdb.c
+++ b/lib/tdb2/tdb.c
@@ -116,6 +116,12 @@ enum TDB_ERROR tdb_store(struct tdb_context *tdb,
struct tdb_used_record rec;
enum TDB_ERROR ecode;
+ if (tdb->flags & TDB_VERSION1) {
+ if (tdb1_store(tdb, key, dbuf, flag) == -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;