aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-12-17 18:05:44 +0100
committerMax Kellermann <max@duempel.org>2014-12-17 19:12:01 +0100
commit90709b332a5514e19d572138cbd96c9364740bf8 (patch)
tree8dd6a48ea17dba5c062f89cbbc66754467412e88 /src
parent81f17d10c8a817cd9f2b40608c7ccdf5d038ad8a (diff)
downloadmpd-90709b332a5514e19d572138cbd96c9364740bf8.tar.gz
mpd-90709b332a5514e19d572138cbd96c9364740bf8.tar.xz
mpd-90709b332a5514e19d572138cbd96c9364740bf8.zip
LogInit: make stderr line-buffered
Make sure everything gets logged right away. No delays because stdio's buffer is not yet full.
Diffstat (limited to 'src')
-rw-r--r--src/LogInit.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/LogInit.cxx b/src/LogInit.cxx
index accd1d4d8..117c6d8dc 100644
--- a/src/LogInit.cxx
+++ b/src/LogInit.cxx
@@ -111,6 +111,9 @@ log_early_init(bool verbose)
#ifdef ANDROID
(void)verbose;
#else
+ /* force stderr to be line-buffered */
+ setvbuf(stderr, nullptr, _IOLBF, 0);
+
if (verbose)
SetLogThreshold(LogLevel::DEBUG);
#endif