summaryrefslogtreecommitdiffhomepage
path: root/gui
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2019-03-18 15:30:21 +0100
committerStanislaw Halik <sthalik@misaki.pl>2019-03-18 16:50:23 +0100
commit2002ab0030c670ee1702794ebbe7b989b8bf2b98 (patch)
tree2f57ef5130fd4e9f5b3dffda3cdd001ab507fe0b /gui
parent46300d64f240343aa02a4ea154817eae59945552 (diff)
gui: set line buffering for stderr
Diffstat (limited to 'gui')
-rw-r--r--gui/init.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/gui/init.cpp b/gui/init.cpp
index db7ab46f..94ab9af8 100644
--- a/gui/init.cpp
+++ b/gui/init.cpp
@@ -240,7 +240,14 @@ static int run_window(std::unique_ptr<QWidget> main_window)
int otr_main(int argc, char** argv, std::function<std::unique_ptr<QWidget>()> const& make_main_window)
{
+#ifdef _WIN32
+ (void)setvbuf(stderr, nullptr, _IONBF, 0);
+#else
+ (void)setvbuf(stderr, nullptr, _IOLBF, 256);
+#endif
+
set_fp_mask();
+
#ifdef OTR_X11_THREADS
enable_x11_threads();
#endif
@@ -256,7 +263,6 @@ int otr_main(int argc, char** argv, std::function<std::unique_ptr<QWidget>()> co
add_win32_path();
attach_parent_console();
#endif
-
(void)qInstallMessageHandler(qdebug_to_console);
QDir::setCurrent(OPENTRACK_BASE_PATH);