]> git.wh0rd.org - dump.git/blobdiff - dump/main.c
QFA fixes.
[dump.git] / dump / main.c
index 15d00f32cefd275f118552e47117a406a5cf7496..0d1f4fd19adb082e7ec6ec376db9ce1b6009f15a 100644 (file)
@@ -41,7 +41,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-       "$Id: main.c,v 1.50 2001/07/18 09:12:05 stelian Exp $";
+       "$Id: main.c,v 1.52 2001/07/18 13:12:33 stelian Exp $";
 #endif /* not lint */
 
 #include <config.h>
@@ -353,7 +353,7 @@ main(int argc, char *argv[])
                tapeprefix = "standard output";
        }
 
-       if (blocksperfile)
+       if (blocksperfile && !compressed)
                blocksperfile = blocksperfile / ntrec * ntrec; /* round down */
        else if (!unlimited) {
                /*
@@ -519,10 +519,18 @@ main(int argc, char *argv[])
                strncpy(tape, tapeprefix, MAXPATHLEN);
        tape[MAXPATHLEN - 1] = '\0';
 
+       if (!pipeout) {
+               if (STAT(tape, &statbuf) != -1)
+                       fifoout= statbuf.st_mode & S_IFIFO;
+       }
+
        if (!sizest) {
 
                msg("Date of this level %c dump: %s", level,
                    ctime4(&spcl.c_date));
+#ifdef USE_QFA
+               gThisDumpDate = spcl.c_date;
+#endif
                if (spcl.c_ddate)
                        msg("Date of last level %c dump: %s", lastlevel,
                            ctime4(&spcl.c_ddate));
@@ -820,7 +828,7 @@ main(int argc, char *argv[])
 
        tnow = trewind();
 
-       if (pipeout)
+       if (pipeout || fifoout)
                msg("%ld tape blocks (%.2fMB)\n", spcl.c_tapea,
                        ((double)spcl.c_tapea * TP_BSIZE / 1048576));
        else
@@ -923,7 +931,7 @@ sig(int signo)
        case SIGHUP:
        case SIGTERM:
        case SIGTRAP:
-               if (pipeout)
+               if (pipeout || fifoout)
                        quit("Signal on pipe: cannot recover\n");
                msg("Rewriting attempted as response to unknown signal: %d.\n", signo);
                (void)fflush(stderr);