Module: tools Branch: master Commit: 5ad327f290b87ec750ecd4ccdf7edb7a46af1866 URL: http://source.winehq.org/git/tools.git/?a=commit;h=5ad327f290b87ec750ecd4ccd...
Author: Francois Gouget fgouget@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@codeweavers.com Signed-off-by: Alexandre Julliard julliard@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; }