log: flush the warning log after redirecting stderr to the log files

Previously, the warning log was only flushed if creating the db or logging
to stdout.  This meant that under normal circumstances (no db creation,
logging to files) the warning log was never flushed.  This caused a bug
when a warning was printed for each call to the status command where the
warning buffer would grow endlessly, eventually using more and more CPU to
reallocate it.

git-svn-id: https://svn.musicpd.org/mpd/trunk@6660 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
J. Alexander Treuman 2007-06-29 18:41:02 +00:00
parent 5a2f854914
commit 54e6b27989

View File

@ -175,6 +175,7 @@ void setup_log_output(const int use_stdout)
if (!use_stdout) {
redirect_logs();
stdout_mode = 0;
flushWarningLog();
}
redirect_stdin();
}