X-Git-Url: https://git.wh0rd.org/?p=dump.git;a=blobdiff_plain;f=restore%2Ftape.c;h=fa4a9618f3a8323ef7f5ea3ea0e18ab46c6dea57;hp=3d673b62b740c9c1057e70a2ef6c3d0cd9dec469;hb=2e555f4100de1ce92bb01d09fd4b635fb0e133f4;hpb=db80efa5e8003ae2458073e328260d23aa603bcf diff --git a/restore/tape.c b/restore/tape.c index 3d673b6..fa4a961 100644 --- a/restore/tape.c +++ b/restore/tape.c @@ -42,7 +42,7 @@ #ifndef lint static const char rcsid[] = - "$Id: tape.c,v 1.92 2007/02/22 20:16:23 stelian Exp $"; + "$Id: tape.c,v 1.94 2009/12/03 12:46:30 stelian Exp $"; #endif /* not lint */ #include @@ -474,7 +474,6 @@ getvol(long nextvol) if (nextvol == 1) { tapesread = 0; gettingfile = 0; - tpblksread = 0; blksread = 0; } if (pipein) { @@ -893,16 +892,14 @@ extractfile(struct entry *ep, int doremove) case IFIFO: Vprintf(stdout, "extract fifo %s\n", name); - if (Nflag) { - skipfile(); + skipfile(); + if (Nflag) return (GOOD); - } if (! (spcl.c_flags & DR_METAONLY)) { if (uflag && !Nflag) (void)unlink(name); if (mkfifo(name, mode) < 0) { warn("%s: cannot create fifo", name); - skipfile(); return (FAIL); } } @@ -923,22 +920,19 @@ extractfile(struct entry *ep, int doremove) (void) chflags(name, flags); #endif #endif - skipfile(); return (GOOD); case IFCHR: case IFBLK: Vprintf(stdout, "extract special file %s\n", name); - if (Nflag) { - skipfile(); + skipfile(); + if (Nflag) return (GOOD); - } if (! (spcl.c_flags & DR_METAONLY)) { if (uflag) (void)unlink(name); if (mknod(name, mode, (int)curfile.dip->di_rdev) < 0) { warn("%s: cannot create special file", name); - skipfile(); return (FAIL); } } @@ -965,7 +959,6 @@ extractfile(struct entry *ep, int doremove) } #endif #endif - skipfile(); return (GOOD); case IFREG: @@ -1333,7 +1326,11 @@ loop: break; } } - if (gethead(&spcl) == GOOD && size > 0) { + while (gethead(&spcl) != GOOD) { + fprintf(stderr, "Incorrect block for %s at %ld blocks\n", + curfile.name, (long)blksread); + } + if (size > 0) { if (spcl.c_type == TS_ADDR) goto loop; Dprintf(stdout,