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.
This commit is contained in:
parent
f5206db9b0
commit
6847536669
1 changed files with 3 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue