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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user