From c4b9454807efa2e1717010f87c2c226ea785f1e5 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Wed, 23 Dec 2009 00:17:37 +0100 Subject: log: enhance close_log_file to reset logfile_fd to -1 after closing Michael --- src/log.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/log.c b/src/log.c index c799ff0..c983162 100644 --- a/src/log.c +++ b/src/log.c @@ -78,7 +78,12 @@ int open_log_file (const char *log_file_name) */ void close_log_file (void) { + if (log_file_fd < 0) { + return; + } + close (log_file_fd); + log_file_fd = -1; } /* -- cgit v1.2.3