X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=dump%2Fmain.c;h=5953f3941f2a866f6eabff7100e4b17cf2845dcb;hb=e7850aac218f2c009303b0a65903c54157139d0c;hp=82ff7f2e386e5f3dd3c161d9cb5ac6b1edc168f2;hpb=95c74f382492999827000f544fcb6844150cda81;p=dump.git diff --git a/dump/main.c b/dump/main.c index 82ff7f2..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.48 2001/04/27 15:22:47 stelian Exp $"; + "$Id: main.c,v 1.51 2001/07/18 09:50:48 stelian Exp $"; #endif /* not lint */ #include @@ -58,10 +58,14 @@ static const char rcsid[] = #include #include +#include #ifdef __linux__ +#ifdef HAVE_EXT2FS_EXT2_FS_H +#include +#else #include +#endif #include -#include #include #include #elif defined sunos @@ -349,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) { /* @@ -515,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, @@ -816,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 @@ -919,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);