#ifndef lint
static const char rcsid[] =
- "$Id: tape.c,v 1.67 2002/04/11 14:51:09 stelian Exp $";
+ "$Id: tape.c,v 1.69 2002/07/01 11:54:40 stelian Exp $";
#endif /* not lint */
#include <config.h>
blocksthisvol += ntrec;
if (!pipeout && !unlimited) {
if (blocksperfile) {
- if ( compressed ? (bytes_written - tapea_bytes + SLAVES * (writesize + sizeof(struct tapebuf))) >= blocksperfile * 1024
+ if ( compressed ? (bytes_written - tapea_bytes + SLAVES * (writesize + sizeof(struct tapebuf))) >= (((long long)blocksperfile) * 1024)
: blocksthisvol >= blocksperfile ) {
close_rewind();
startnewtape(0);
#ifdef RDUMP
if (host) {
rmtclose();
- while (rmtopen(tape, 0) < 0)
+ while (rmtopen(tape, "O_RDONLY") < 0)
sleep(10);
rmtclose();
}
{
(void) close(tapefd);
if (!fifoout) {
- while ((f = OPEN(tape, 0)) < 0)
+ while ((f = OPEN(tape, O_RDONLY)) < 0)
sleep (10);
(void) close(f);
}
msg("Dumping volume %d on %s\n", tapeno, tape);
}
#ifdef RDUMP
- while ((tapefd = (host ? rmtopen(tape, 2) : pipeout ?
+ while ((tapefd = (host ? rmtopen(tape, "O_WRONLY|O_CREAT|O_TRUNC") : pipeout ?
fileno(stdout) :
- OPEN(tape, O_WRONLY|O_CREAT, 0666))) < 0)
+ OPEN(tape, O_WRONLY|O_CREAT|O_TRUNC, 0666))) < 0)
#else
while ((tapefd = (pipeout ? fileno(stdout) :
- OPEN(tape, O_RDWR|O_CREAT, 0666))) < 0)
+ OPEN(tape, O_WRONLY|O_CREAT|O_TRUNC, 0666))) < 0)
#endif
{
msg("Cannot open output \"%s\": %s\n", tape,