tdb2: unify tdb1_store into tdb_store
[kai/samba.git] / lib / tdb2 / tdb.c
index 14bf059966b0e20986dcc0bcd2b6e04e9c9e010c..806fb037a4d0d155c5e7a9d631bce75f0a4f4756 100644 (file)
@@ -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;