X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=dump%2Fmain.c;h=5953f3941f2a866f6eabff7100e4b17cf2845dcb;hb=c534413c6ada5778ccbb76f36bdcff672037d0cc;hp=15d00f32cefd275f118552e47117a406a5cf7496;hpb=2fa54f1c7aa08d2c6e0b357a35c7e22d3ca302e0;p=dump.git diff --git a/dump/main.c b/dump/main.c index 15d00f3..5953f39 100644 --- a/dump/main.c +++ b/dump/main.c @@ -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.51 2001/07/18 09:50:48 stelian Exp $"; #endif /* not lint */ #include @@ -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,6 +519,11 @@ 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, @@ -820,7 +825,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 +928,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);