Francois Gouget : testbot/testagentd: Disable buffering on stderr on Windows.

Alexandre Julliard julliard at winehq.org
Mon Dec 19 12:11:21 CST 2016


Module: tools
Branch: master
Commit: 5ad327f290b87ec750ecd4ccdf7edb7a46af1866
URL:    http://source.winehq.org/git/tools.git/?a=commit;h=5ad327f290b87ec750ecd4ccdf7edb7a46af1866

Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Mon Dec 19 07:58:47 2016 +0100

testbot/testagentd: Disable buffering on stderr on Windows.

This reduces the risk of losing part of the log in case testagentd
or Windows crashes.

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 testbot/src/testagentd/platform_windows.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/testbot/src/testagentd/platform_windows.c b/testbot/src/testagentd/platform_windows.c
index 8e00f09..c72cf25 100644
--- a/testbot/src/testagentd/platform_windows.c
+++ b/testbot/src/testagentd/platform_windows.c
@@ -468,5 +468,11 @@ int platform_init(void)
     hdll = GetModuleHandle("ws2_32");
     pgetaddrinfo = (void*)GetProcAddress(hdll, "getaddrinfo");
     pfreeaddrinfo = (void*)GetProcAddress(hdll, "freeaddrinfo");
+
+    /* By default stderr is fully buffered and Windows does not support
+     * line buffering. So disable buffering altogether.
+     */
+    setvbuf(stderr, NULL, _IONBF, 0);
+
     return 1;
 }




More information about the wine-cvs mailing list