summaryrefslogtreecommitdiff
path: root/navit/log.c
diff options
context:
space:
mode:
authorStefan Wildemann <metalstrolch@users.noreply.github.com>2019-10-30 02:03:04 +0100
committerPierre GRANDIN <pgrandin@users.noreply.github.com>2019-10-29 19:03:04 -0600
commit10f514af97b3491072a172b3e0f3e78de455bfb3 (patch)
treef69b02446ffd41ea8eb37e65e6d5def590bb963d /navit/log.c
parentc62df58958a3a086521b9a6796c6c793f4f68d57 (diff)
downloadnavit-10f514af97b3491072a172b3e0f3e78de455bfb3.tar.gz
fix:all:fix compiler warnings (#935)
* fix:core:remove many compiler warnings from core
Diffstat (limited to 'navit/log.c')
-rw-r--r--navit/log.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/navit/log.c b/navit/log.c
index 3c40e9152..d68312938 100644
--- a/navit/log.c
+++ b/navit/log.c
@@ -47,7 +47,9 @@
#include "debug.h"
#include "xmlconfig.h"
#include "log.h"
-
+#ifndef HAVE_API_WIN32_BASE
+#include <errno.h>
+#endif
struct log_data {
int len;
int max_len;
@@ -239,7 +241,8 @@ static void log_flush(struct log *this_, enum log_flags flags) {
#ifndef HAVE_API_WIN32_BASE
if (flags & log_flag_truncate) {
pos=ftell(this_->f);
- ftruncate(fileno(this_->f), pos);
+ if(ftruncate(fileno(this_->f), pos) <0)
+ dbg(lvl_error,"Error on fruncate (%s)", strerror(errno));
}
#endif
if (this_->trailer.len) {