tdb: suppress record write locks when allrecord lock is taken.
[ira/wip.git] / lib / tdb / common / check.c
index 4924734fdd8134c7db1a2b2972631d2988f280ce..6bbfd7d82aceecc4114395a2d61619e373525f2e 100644 (file)
@@ -329,7 +329,8 @@ int tdb_check(struct tdb_context *tdb,
        }
 
        /* One big malloc: pointers then bit arrays. */
-       hashes = calloc(1, sizeof(hashes[0]) * (1+tdb->header.hash_size)
+       hashes = (unsigned char **)calloc(
+                       1, sizeof(hashes[0]) * (1+tdb->header.hash_size)
                        + BITMAP_BITS / CHAR_BIT * (1+tdb->header.hash_size));
        if (!hashes) {
                tdb->ecode = TDB_ERR_OOM;
@@ -369,7 +370,7 @@ int tdb_check(struct tdb_context *tdb,
                                goto free;
                        break;
                case TDB_RECOVERY_MAGIC:
-               case 0: /* Used for invalid (or in-progress) recovery area. */
+               case TDB_RECOVERY_INVALID_MAGIC:
                        if (recovery_start != off) {
                                TDB_LOG((tdb, TDB_DEBUG_ERROR,
                                         "Unexpected recovery record at offset %d\n",