X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=src%2Fverify.c;h=a9de114642138b6aa1bbcb2c9b1f8b012c0366e6;hp=10db163550dfe8cea3381ec7936a2d9a768ff376;hb=1c19875f1bcbfe341014b20b9bbbc9b5fa0cea4d;hpb=fad8b28269c0b29f617c7e6cd9e00cd92df46a21 diff --git a/src/verify.c b/src/verify.c index 10db1635..a9de1146 100644 --- a/src/verify.c +++ b/src/verify.c @@ -151,13 +151,16 @@ tally_image_refcnts(WIMStruct *wim) * problem by looking at ALL the images to re-calculate the reference count of * EVERY lookup table entry. This only absolutely has to be done before an image * is deleted or before an image is mounted read-write. */ -void +int wim_recalculate_refcnts(WIMStruct *wim) { unsigned long num_ltes_with_bogus_refcnt = 0; + int ret; for_lookup_table_entry(wim->lookup_table, lte_zero_real_refcnt, NULL); - for_image(wim, WIMLIB_ALL_IMAGES, tally_image_refcnts); + ret = for_image(wim, WIMLIB_ALL_IMAGES, tally_image_refcnts); + if (ret) + return ret; num_ltes_with_bogus_refcnt = 0; for_lookup_table_entry(wim->lookup_table, lte_fix_refcnt, &num_ltes_with_bogus_refcnt); @@ -168,4 +171,5 @@ wim_recalculate_refcnts(WIMStruct *wim) num_ltes_with_bogus_refcnt); } wim->refcnts_ok = 1; + return 0; }