#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__
#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),
*/
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, ',')) {
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
{