X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=restore%2Ftape.c;h=08bb3757e7b638ece4d9f09048abb9d9072df6a5;hb=6d732772201861bc57348f4ad5c0970ac00b5d93;hp=a8616a1069eaf3b7a90635bc523c6b4a716fffd6;hpb=c534413c6ada5778ccbb76f36bdcff672037d0cc;p=dump.git diff --git a/restore/tape.c b/restore/tape.c index a8616a1..08bb375 100644 --- a/restore/tape.c +++ b/restore/tape.c @@ -46,7 +46,7 @@ #ifndef lint static const char rcsid[] = - "$Id: tape.c,v 1.42 2001/07/18 12:54:06 stelian Exp $"; + "$Id: tape.c,v 1.44 2001/07/18 14:57:46 stelian Exp $"; #endif /* not lint */ #include @@ -379,11 +379,12 @@ setup(void) void getvol(long nextvol) { - long newvol = 0, savecnt = 0, wantnext = 0, i; + long newvol = 0, wantnext = 0, i; + long saved_blksread = 0, saved_tpblksread = 0; union u_spcl tmpspcl; # define tmpbuf tmpspcl.s_spcl char buf[TP_BSIZE]; - int haderror = 0, bot_code; + int haderror = 0, bot_code = 1; if (nextvol == 1) { tapesread = 0; @@ -396,7 +397,8 @@ getvol(long nextvol) return; goto gethdr; } - savecnt = blksread; + saved_blksread = blksread; + saved_tpblksread = tpblksread; again: if (pipein) exit(1); /* pipes do not get a second chance */ @@ -499,12 +501,16 @@ gethdr: fprintf(stderr, "tape is not dump tape\n"); volno = 0; haderror = 1; + blksread = saved_blksread; + tpblksread = saved_tpblksread; goto again; } if (tmpbuf.c_volume != volno) { fprintf(stderr, "Wrong volume (%d)\n", tmpbuf.c_volume); volno = 0; haderror = 1; + blksread = saved_blksread; + tpblksread = saved_tpblksread; goto again; } if (tmpbuf.c_date != dumpdate || tmpbuf.c_ddate != dumptime) { @@ -513,10 +519,13 @@ gethdr: fprintf(stderr, "\twanted: %s", ctime(&dumpdate)); volno = 0; haderror = 1; + blksread = saved_blksread; + tpblksread = saved_tpblksread; goto again; } tapesread |= 1 << volno; - blksread = savecnt; + blksread = saved_blksread; + tpblksread = saved_tpblksread; /* * If continuing from the previous volume, skip over any * blocks read already at the end of the previous volume.