X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/9175a8d2ac50382af2045b37e7b054180f91f4e8..ef394e8db2af178e91ed15cc63905016d00952f4:/src/exim_monitor/em_main.c diff --git a/src/exim_monitor/em_main.c b/src/exim_monitor/em_main.c index e8e763184..3034a041c 100644 --- a/src/exim_monitor/em_main.c +++ b/src/exim_monitor/em_main.c @@ -2,7 +2,7 @@ * Exim Monitor * *************************************************/ -/* Copyright (c) University of Cambridge 1995 - 2012 */ +/* Copyright (c) University of Cambridge 1995 - 2016 */ /* See the file NOTICE for conditions of use and distribution. */ @@ -669,8 +669,14 @@ if (log_file[0] != 0) { fseek(LOG, 0, SEEK_END); log_position = ftell(LOG); - fstat(fileno(LOG), &statdata); - log_inode = statdata.st_ino; + if (fstat(fileno(LOG), &statdata)) + { + perror("log file fstat"); + fclose(LOG); + LOG=NULL; + } + else + log_inode = statdata.st_ino; } } else