From: Miroslav Lichvar Date: Tue, 28 Aug 2018 12:04:44 +0000 (+0200) Subject: logging: close previous file log after opening new one X-Git-Tag: 3.4-pre1~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=68475366697e844aaffea576bf65633858d6eba6;p=thirdparty%2Fchrony.git logging: close previous file log after opening new one Currently, the log is always opened only once, but that will change with tests temporarily suspending logging. --- diff --git a/logging.c b/logging.c index aee69405..0f73a457 100644 --- a/logging.c +++ b/logging.c @@ -191,6 +191,9 @@ LOG_OpenFileLog(const char *log_file) /* Enable line buffering */ setvbuf(f, NULL, _IOLBF, BUFSIZ); + if (file_log && file_log != stderr) + fclose(file_log); + file_log = f; }