Don't ignore retval of ftruncate() in utils.c

This commit is contained in:
Mukund Sivaraman committed 2009-09-27 08:09:23 +05:30
1 parent 1586b39138
commit 0ecb688269
1 file changed
+5 -1
+5 -1
View File
@@ -28,6 +28,7 @@
#include "conns.h"
#include "heap.h"
#include "http-message.h"
#include "log.h"
#include "utils.h"
/*
@@ -158,7 +159,10 @@ int create_file_safely (const char *filename, unsigned int truncate_file)
* ("Little sympathy has been extended")
*/
#ifdef HAVE_FTRUNCATE
ftruncate (fildes, 0);
if (ftruncate (fildes, 0) != 0) {
log_message (LOG_WARNING,
"Unable to truncate file '%s'", filename);
}
#else
close (fildes);
if ((fildes =