From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MVL9y-0001fd-AW for qemu-devel@nongnu.org; Mon, 27 Jul 2009 04:02:14 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MVL9t-0001cm-94 for qemu-devel@nongnu.org; Mon, 27 Jul 2009 04:02:13 -0400 Received: from [199.232.76.173] (port=39472 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MVL9s-0001cf-VY for qemu-devel@nongnu.org; Mon, 27 Jul 2009 04:02:09 -0400 Received: from mx20.gnu.org ([199.232.41.8]:14409) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MVL9s-00063E-CR for qemu-devel@nongnu.org; Mon, 27 Jul 2009 04:02:08 -0400 Received: from [82.113.48.144] (helo=FilipNavara-PC) by mx20.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1MVL9r-0008E6-Gl for qemu-devel@nongnu.org; Mon, 27 Jul 2009 04:02:07 -0400 Date: Mon, 27 Jul 09 10:02:04 Central Europe Standard Time From: Filip Navara Sender: Filip Navara MIME-Version: 1.0 Content-Type: text/plain; Message-Id: Subject: [Qemu-devel] [PATCH 3/5] Remove setvbuf(, NULL, _IOLBF, 0) calls for Win32 List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On Win32 the setvbuf function requires the last parameter to be size between 2 and INT_MAX bytes, so the calls always failed. Since the whole point of the calls is to set line-buffered mode for the file handle and that's not supported on Win32 anyway, conditionally remove them. Signed-off-by: Filip Navara --- exec.c | 3 ++- vl.c | 3 +++ 2 files changed, 5 insertions(+), 1 deletions(-) diff --git a/exec.c b/exec.c index 7d3eb1a..ef79d6d 100644 --- a/exec.c +++ b/exec.c @@ -1491,7 +1491,8 @@ void cpu_set_log(int log_flags) static char logfile_buf[4096]; setvbuf(logfile, logfile_buf, _IOLBF, sizeof(logfile_buf)); } -#else +#elif !defined(_WIN32) + /* Win32 doesn't support line-buffering and requires size >= 2 */ setvbuf(logfile, NULL, _IOLBF, 0); #endif log_append = 1; diff --git a/vl.c b/vl.c index ce213c2..d4e49e4 100644 --- a/vl.c +++ b/vl.c @@ -5735,7 +5735,10 @@ int main(int argc, char **argv, char **envp) exit(1); } +#ifndef _WIN32 + /* Win32 doesn't support line-buffering and requires size >= 2 */ setvbuf(stdout, NULL, _IOLBF, 0); +#endif init_timers(); if (init_timer_alarm() < 0) { -- 1.6.3.2.1299.gee46c