]> git.ozlabs.org Git - ccan/blobdiff - ccan/tdb2/check.c
tdb2: unify tdb1_check and tdb1_summary into tdb_check and tdb_summary.
[ccan] / ccan / tdb2 / check.c
index 6d846f414264404255eac5f67d0c93ea824b219b..b3874c6d27b1b48256b748608a29d0e0b184a6e1 100644 (file)
@@ -782,6 +782,12 @@ enum TDB_ERROR tdb_check_(struct tdb_context *tdb,
        uint64_t features;
        enum TDB_ERROR ecode;
 
+       if (tdb->flags & TDB_VERSION1) {
+               if (tdb1_check(tdb, check, data) == -1)
+                       return tdb->last_error;
+               return TDB_SUCCESS;
+       }
+
        ecode = tdb_allrecord_lock(tdb, F_RDLCK, TDB_LOCK_WAIT, false);
        if (ecode != TDB_SUCCESS) {
                return tdb->last_error = ecode;