X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Ftdb%2Ffreelistcheck.c;h=5afcaa2a18967094d074b4232d9d1383e05b640c;hp=8d1ebabe04e85c9c3650797bde2a83f187b9ce2b;hb=97648992fdd50535fe276261368c179df993202b;hpb=03d4aa56b8bd381db449b36befa6928594cea994 diff --git a/ccan/tdb/freelistcheck.c b/ccan/tdb/freelistcheck.c index 8d1ebabe..5afcaa2a 100644 --- a/ccan/tdb/freelistcheck.c +++ b/ccan/tdb/freelistcheck.c @@ -47,7 +47,7 @@ int tdb_validate_freelist(struct tdb_context *tdb, int *pnum_entries) { struct tdb_context *mem_tdb = NULL; struct tdb_record rec; - tdb_off_t rec_ptr, last_ptr; + tdb_off_t rec_ptr; int ret = -1; *pnum_entries = 0; @@ -63,10 +63,8 @@ int tdb_validate_freelist(struct tdb_context *tdb, int *pnum_entries) return 0; } - last_ptr = FREELIST_TOP; - /* Store the FREELIST_TOP record. */ - if (seen_insert(mem_tdb, last_ptr) == -1) { + if (seen_insert(mem_tdb, FREELIST_TOP) == -1) { tdb->ecode = TDB_ERR_CORRUPT; ret = -1; goto fail; @@ -94,7 +92,6 @@ int tdb_validate_freelist(struct tdb_context *tdb, int *pnum_entries) } /* move to the next record */ - last_ptr = rec_ptr; rec_ptr = rec.next; *pnum_entries += 1; }