X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=restore%2Ftape.c;h=cd133cb7cf9c63a2b714b1920e6ad2827e2cdd27;hb=bf8ee3da71be895b97f0496f9f7d5850279f2940;hp=fb5c816e974ad6c3a6406d8d7d6282dece01fb97;hpb=88ef261eaffd1b09f23eb73d8259336f694d9324;p=dump.git diff --git a/restore/tape.c b/restore/tape.c index fb5c816..cd133cb 100644 --- a/restore/tape.c +++ b/restore/tape.c @@ -46,7 +46,7 @@ #ifndef lint static const char rcsid[] = - "$Id: tape.c,v 1.46 2001/08/16 15:24:22 stelian Exp $"; + "$Id: tape.c,v 1.48 2001/11/16 14:09:07 stelian Exp $"; #endif /* not lint */ #include @@ -1492,6 +1492,9 @@ readtape_comprfile(char *buf) /* read the block prefix */ ret = read_a_block(mt, tapebuf, PREFIXSIZE, &rl); + + if (Vflag && (ret == 0 || rl < PREFIXSIZE || tpb->length == 0)) + ret = 0; if (ret <= 0) goto readerr; @@ -1926,13 +1929,15 @@ setmagtapein(void) { /* need to know if input is really from a tape */ #ifdef RRESTORE if (host) - magtapein = rmtioctl(MTNOP, 1) != -1; + magtapein = !lflag; else #endif magtapein = ioctl(mt, MTIOCGET, (char *)&mt_stat) == 0; } - Vprintf(stdout,"Input is from %s\n", magtapein? "tape": "file/pipe"); + Vprintf(stdout,"Input is from %s\n", + magtapein ? "tape" : + Vflag ? "multi-volume (no tape)" : "file/pipe"); } /*