]> mj.ucw.cz Git - libucw.git/commitdiff
Due to a bug, the "fsck" mode was unable to fix broken trailers.
authorMartin Mares <mj@ucw.cz>
Fri, 5 Jul 2002 03:24:25 +0000 (03:24 +0000)
committerMartin Mares <mj@ucw.cz>
Fri, 5 Jul 2002 03:24:25 +0000 (03:24 +0000)
lib/buckettool.c

index eaf376c76da98c22a95bcbee56541add479dfd2e..45410f00e66c2636e6986f7378c5547129ac3e28 100644 (file)
@@ -186,9 +186,12 @@ fsck(int fix)
            printf("%08x  missing trailer\n", oid);
          else if (chk != OBUCK_TRAILER)
            printf("%08x  mismatched trailer\n", oid);
-         /* OK */
-         pos = end;
-         continue;
+         else
+           {
+             /* OK */
+             pos = end;
+             continue;
+           }
        }
       errors++;
       end = pos;
@@ -227,6 +230,8 @@ fsck(int fix)
          sh_pwrite(fd, &chk, 4, end-4);
          printf("*** replaced the invalid chunk by a DELETED bucket of size %d\n", (uns)(end - pos));
        }
+      else
+       printf("*** would mark %d bytes as DELETED\n", (uns)(end - pos));
       pos = end;
     }
  finish: