From c165131c3f255a034dc8ca31d1046ff2f6e401b7 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Sun, 26 Nov 2023 15:36:50 +0800 Subject: [PATCH] Disable stdout buffering for qbt-nox The messages printed out via stdout is usually important and short so there is no reason to buffer them. Closes #19984. PR #20018. --- src/app/main.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/app/main.cpp b/src/app/main.cpp index 18623146e..7bbc305e4 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -104,6 +104,10 @@ void adjustFileDescriptorLimit(); // Main int main(int argc, char *argv[]) { +#ifdef DISABLE_GUI + setvbuf(stdout, nullptr, _IONBF, 0); +#endif + #ifdef Q_OS_UNIX adjustFileDescriptorLimit(); #endif