aboutsummaryrefslogtreecommitdiff
path: root/games/qtv/files/patch-src_main.c
blob: 42aa78f7e0076c876339e45a8b2dfb2f21fc80fa (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
--- src/main.c.orig	2025-02-16 14:10:58 UTC
+++ src/main.c
@@ -274,6 +274,12 @@ int main(int argc, char **argv)
 	}
 	#endif // _WIN32
 
+	// Disable buffering for stdout and stderr to avoid issues when output
+	// is redirected to a file or pipe instead of being displayed in a
+	// terminal.
+	setbuf(stdout, NULL);
+	setbuf(stderr, NULL);
+
 	memset(&g_cluster, 0, sizeof(g_cluster));
 
 	g_cluster.tcpsocket   = INVALID_SOCKET;