Better cope with a failed or unavailable ftruncate().

Added HAVE_FTRUNCATE to all the static config-*.h files on the assumption
that all those systems provide it.
This commit is contained in:
Dan Fandrich
2005-03-05 00:54:16 +00:00
parent 31891b55a4
commit 42ac24448c
8 changed files with 18 additions and 1 deletions

View File

@@ -3771,10 +3771,12 @@ operate(struct Configurable *config, int argc, char *argv[])
" bytes\n", outs.bytes);
fflush(outs.stream);
/* truncate file at the position where we started appending */
#ifdef HAVE_FTRUNCATE
ftruncate( fileno(outs.stream), outs.init);
#endif
/* now seek to the end of the file, the position where we
just truncated the file */
fseek(outs.stream, 0, SEEK_END);
fseek(outs.stream, outs.init, SEEK_SET);
outs.bytes = 0; /* clear for next round */
}
continue;