]> git.wh0rd.org - dump.git/blobdiff - restore/tape.c
Fixed the remote tape/file detection in restore.
[dump.git] / restore / tape.c
index fb5c816e974ad6c3a6406d8d7d6282dece01fb97..cd133cb7cf9c63a2b714b1920e6ad2827e2cdd27 100644 (file)
@@ -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 <config.h>
@@ -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");
 }
 
 /*