tdb2: fix tdb_check() return when free table entries missing.
authorRusty Russell <rusty@rustcorp.com.au>
Wed, 1 Dec 2010 12:36:56 +0000 (23:06 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Wed, 1 Dec 2010 12:36:56 +0000 (23:06 +1030)
It mistakenly returned -1 meaning "success".

ccan/tdb2/check.c

index c7d83837c9772b70c6e47c359993a94c3e21c0d3..c5450cccb0cd17d9e8ba248db18fb272b152023c 100644 (file)
@@ -572,7 +572,7 @@ int tdb_check(struct tdb_context *tdb,
        if (num_found != num_free) {
                tdb->log(tdb, TDB_DEBUG_ERROR, tdb->log_priv,
                         "tdb_check: Not all entries are in free table\n");
-               return false;
+               return -1;
        }
 
        tdb_allrecord_unlock(tdb, F_RDLCK);