X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=restore%2Ftape.c;h=4b4f7362ccf6a97713c9edcfd7b8e315cf1f543a;hb=8096304ebfb616914df99e42e4dd78dbce667188;hp=344ca3b46fadd47079622653e5fcc07f19ac47d4;hpb=8b7882a833092b5974aa73e06b2e55bb9d1a9e99;p=dump.git diff --git a/restore/tape.c b/restore/tape.c index 344ca3b..4b4f736 100644 --- a/restore/tape.c +++ b/restore/tape.c @@ -46,7 +46,7 @@ #ifndef lint static const char rcsid[] = - "$Id: tape.c,v 1.47 2001/09/12 10:21:49 stelian Exp $"; + "$Id: tape.c,v 1.50 2001/12/24 15:53:41 stelian Exp $"; #endif /* not lint */ #include @@ -97,7 +97,7 @@ int noresyncmesg = 0; #endif /* USE_QFA */ static long fssize = MAXBSIZE; static int mt = -1; -static int pipein = 0; +int pipein = 0; static int magtapein = 0; /* input is from magtape */ static char magtape[MAXPATHLEN]; static char magtapeprefix[MAXPATHLEN]; @@ -432,12 +432,16 @@ again: fprintf(stderr, "\n"); } do { - fprintf(stderr, "Specify next volume #: "); + fprintf(stderr, "Specify next volume # (none if no more volumes): "); (void) fflush(stderr); (void) fgets(buf, TP_BSIZE, terminal); } while (!feof(terminal) && buf[0] == '\n'); if (feof(terminal)) exit(1); + if (!strcmp(buf, "none\n")) { + terminateinput(); + return; + } newvol = atoi(buf); if (newvol <= 0) { fprintf(stderr, @@ -1929,7 +1933,7 @@ 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;