# HG changeset patch # User Daniele Nicolodi # Date 1414428502 -3600 # Node ID 28a56e4c06a431cb421240a0722e3207d7f1af01 # Parent 5e69d9abbbf2f24afd5631bf3bf9c4908195db7e Improvements to log file handling diff -r 5e69d9abbbf2 -r 28a56e4c06a4 logging.c --- a/logging.c Thu Oct 09 15:58:32 2014 +0200 +++ b/logging.c Mon Oct 27 17:48:22 2014 +0100 @@ -1,6 +1,7 @@ #include #include #include +#include #include "config.h" #include "logging.h" @@ -33,8 +34,12 @@ /* logging file name */ rv = Ini_GetStringCopy(configuration, "logging", "filename", &filename); - if (rv > 0) + if (rv > 0) { + __logmessage(l, INFO, "logging to '%s'", filename); l->fd = open(filename, O_CREAT|O_WRONLY|O_APPEND, 00744); + if (l->fd < 0) + __logmessage(l, ERROR, "open log file %s: %s", filename, strerror(errno)); + } free(filename); Ini_Dispose(configuration);