X-Git-Url: https://git.wh0rd.org/?p=dump.git;a=blobdiff_plain;f=dump%2Ftape.c;h=c6161bedbec52d4863d00af48831f349ec474f0b;hp=0dffa3a7cba384772f087967cf0356e4236412a8;hb=f75cc889d49eebab28ee47034e875ac0eac114a6;hpb=b0b1d9d02b199eddbd62589d01c664ca13262f2d diff --git a/dump/tape.c b/dump/tape.c index 0dffa3a..c6161be 100644 --- a/dump/tape.c +++ b/dump/tape.c @@ -41,7 +41,7 @@ #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 @@ -479,7 +479,7 @@ flushtape(void) 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); @@ -542,7 +542,7 @@ trewind(void) #ifdef RDUMP if (host) { rmtclose(); - while (rmtopen(tape, 0) < 0) + while (rmtopen(tape, "O_RDONLY") < 0) sleep(10); rmtclose(); } @@ -551,7 +551,7 @@ trewind(void) { (void) close(tapefd); if (!fifoout) { - while ((f = OPEN(tape, 0)) < 0) + while ((f = OPEN(tape, O_RDONLY)) < 0) sleep (10); (void) close(f); } @@ -864,12 +864,12 @@ restore_check_point: 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,