#ifndef lint
static const char rcsid[] =
- "$Id: tape.c,v 1.75 2003/03/31 09:42:58 stelian Exp $";
+ "$Id: tape.c,v 1.77 2003/04/18 07:47:57 stelian Exp $";
#endif /* not lint */
#include <config.h>
if (compressed) {
int bsiz = sizeof(struct tapebuf) + writesize;
/* Add extra space to deal with compression enlarging the buffer */
- if (TP_BSIZE > writesize/64 + 19)
+ if (TP_BSIZE > writesize/16 + 67)
bsiz += TP_BSIZE;
else
- bsiz += writesize/64 + 19;
+ bsiz += writesize/16 + 67;
comp_buf = malloc(bsiz);
if (comp_buf == NULL)
quit("couldn't allocate a compress buffer.\n");
#ifdef WRITEDEBUG
printf("slave %d wrote %d\n", slave_number, wrote);
#endif
- if (wrote < 0)
+ if (wrote < 0 && errno != ENOSPC)
break;
- if (wrote == 0)
+ if (wrote == 0 || (wrote < 0 && errno == ENOSPC))
eot_count++;
- size += wrote;
+ else
+ size += wrote;
}
#ifdef WRITEDEBUG