X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=dump%2Ftape.c;h=5a50ff95aaf66e814efad447026639090b8814e9;hb=92a9bf12543aadfcc46e7ab9c2729b4d4d1f22ee;hp=40dd42763ea11b60373cdd927f2e91e0e350c47a;hpb=ebcbe7f6c10482913b60fc792e72e494b439b242;p=dump.git diff --git a/dump/tape.c b/dump/tape.c index 40dd427..5a50ff9 100644 --- a/dump/tape.c +++ b/dump/tape.c @@ -40,7 +40,7 @@ #ifndef lint static const char rcsid[] = - "$Id: tape.c,v 1.11 2000/01/21 10:17:41 stelian Exp $"; + "$Id: tape.c,v 1.14 2000/03/01 10:16:05 stelian Exp $"; #endif /* not lint */ #ifdef __linux__ @@ -311,6 +311,8 @@ statussig(int notused) #else (void) time((time_t *) &tnow); #endif + if (blockswritten > tapesize) + tapesize = blockswritten; deltat = tstart_writing - tnow + (1.0 * (tnow - tstart_writing)) / blockswritten * tapesize; (void)snprintf(msgbuf, sizeof(msgbuf), @@ -713,8 +715,8 @@ restore_check_point: */ tapeno++; /* current tape sequence */ if (Mflag) { - snprintf(tape, NAME_MAX, "%s%03d", tapeprefix, tapeno); - tape[NAME_MAX - 1] = '\0'; + snprintf(tape, MAXPATHLEN, "%s%03d", tapeprefix, tapeno); + tape[MAXPATHLEN - 1] = '\0'; msg("Dumping volume %d on %s\n", tapeno, tape); } else if (nexttape || strchr(tapeprefix, ',')) { @@ -725,15 +727,16 @@ restore_check_point: nexttape = p + 1; } else nexttape = NULL; - strncpy(tape, tapeprefix, NAME_MAX); - tape[NAME_MAX - 1] = '\0'; + strncpy(tape, tapeprefix, MAXPATHLEN); + tape[MAXPATHLEN - 1] = '\0'; msg("Dumping volume %d on %s\n", tapeno, tape); } #ifdef RDUMP - while ((tapefd = (host ? rmtopen(tape, 2) : - pipeout ? 1 : open(tape, O_WRONLY|O_CREAT, 0666))) < 0) + while ((tapefd = (host ? rmtopen(tape, 2) : pipeout ? + fileno(stdout) : + open(tape, O_WRONLY|O_CREAT, 0666))) < 0) #else - while ((tapefd = (pipeout ? 1 : + while ((tapefd = (pipeout ? fileno(stdout) : open(tape, O_WRONLY|O_CREAT, 0666))) < 0) #endif {