/* * Archive set consistency check and repair. */ void tarsnap_mode_fsck(struct bsdtar *bsdtar, int prune, int whichkey) { if (fscktape(bsdtar->machinenum, bsdtar->cachedir, prune, whichkey)) { bsdtar_warnc(bsdtar, 0, "Error fscking archives"); goto err0; } /* * Remove the chunkification cache in case whatever caused the fsck to * be necessary (e.g., disk corruption) also damaged that cache. The * chunkification cache is purely a performance optimization; since * we're dealing with backups here it makes sense to sacrifice some * performance to prevent possible data loss. */ if (ccache_remove(bsdtar->cachedir)) { bsdtar_warnc(bsdtar, 0, "Error removing chunkification cache"); goto err0; } /* Success! */ return; err0: /* Failure! */ bsdtar->return_value = 1; return; }
/* * Archive set consistency check and repair. */ void tarsnap_mode_fsck(struct bsdtar *bsdtar, int prune, int whichkey) { if (fscktape(bsdtar->machinenum, bsdtar->cachedir, prune, whichkey)) goto err1; /* Success! */ return; err1: /* Failure! */ bsdtar_warnc(bsdtar, 0, "Error fscking archives"); exit(1); }