diff options
author | Stefan Weil <sw@weilnetz.de> | 2011-12-03 22:32:37 +0100 |
---|---|---|
committer | Blue Swirl <blauwirbel@gmail.com> | 2011-12-10 17:05:48 +0000 |
commit | daf767b16aeb32e5b9a77066ba130fe723f875ca (patch) | |
tree | ca0ea44b05c64bd63d06e5fea8523ee4f75d706a /exec.c | |
parent | 946fc459969b78966798399d5dc8ec7e6f4a1c1c (diff) | |
download | qemu-daf767b16aeb32e5b9a77066ba130fe723f875ca.zip |
w32: Disable buffering for log file
W32 does not support line buffering, but it supports unbuffered output.
Unbuffered output is better for writing to qemu.log than fully buffered
output because it also shows the latest log messages when an application
crash occurs.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'exec.c')
-rw-r--r-- | exec.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -1603,8 +1603,10 @@ void cpu_set_log(int log_flags) static char logfile_buf[4096]; setvbuf(logfile, logfile_buf, _IOLBF, sizeof(logfile_buf)); } -#elif !defined(_WIN32) - /* Win32 doesn't support line-buffering and requires size >= 2 */ +#elif defined(_WIN32) + /* Win32 doesn't support line-buffering, so use unbuffered output. */ + setvbuf(logfile, NULL, _IONBF, 0); +#else setvbuf(logfile, NULL, _IOLBF, 0); #endif log_append = 1; |