From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LSGkY-0003lK-VR for qemu-devel@nongnu.org; Wed, 28 Jan 2009 15:11:03 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LSGkW-0003is-7e for qemu-devel@nongnu.org; Wed, 28 Jan 2009 15:11:02 -0500 Received: from [199.232.76.173] (port=60520 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LSGkW-0003ie-1c for qemu-devel@nongnu.org; Wed, 28 Jan 2009 15:11:00 -0500 Received: from qw-out-1920.google.com ([74.125.92.147]:40742) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LSGkV-0004Ny-MW for qemu-devel@nongnu.org; Wed, 28 Jan 2009 15:10:59 -0500 Received: by qw-out-1920.google.com with SMTP id 5so1450000qwc.4 for ; Wed, 28 Jan 2009 12:10:57 -0800 (PST) Message-ID: <4980BBC2.3050709@codemonkey.ws> Date: Wed, 28 Jan 2009 14:10:42 -0600 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] flush stdout after printing usage() References: <20090128184713.GA29581@kos.to> In-Reply-To: <20090128184713.GA29581@kos.to> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Riku Voipio wrote: > testcase: > > qemu-arm|grep cpu > > Without fflush() getting output from piped qemu is a bit random. > It should get flushed upon exit(). Perhaps the problem is that we're using _exit() instead of exit()? Regards, Anthony Liguori > Signed-off-by: Riku Voipio > --- > bsd-user/main.c | 1 + > darwin-user/main.c | 1 + > linux-user/main.c | 1 + > 3 files changed, 3 insertions(+), 0 deletions(-) > > diff --git a/bsd-user/main.c b/bsd-user/main.c > index 636f1dc..f3cb3b1 100644 > --- a/bsd-user/main.c > +++ b/bsd-user/main.c > @@ -351,6 +351,7 @@ static void usage(void) > interp_prefix, > x86_stack_size, > DEBUG_LOGFILE); > + fflush(stdout); > _exit(1); > } > > diff --git a/darwin-user/main.c b/darwin-user/main.c > index 3edad73..44e8f7c 100644 > --- a/darwin-user/main.c > +++ b/darwin-user/main.c > @@ -758,6 +758,7 @@ void usage(void) > interp_prefix, > stack_size, > DEBUG_LOGFILE); > + fflush(stdout); > _exit(1); > } > > diff --git a/linux-user/main.c b/linux-user/main.c > index 3418ca6..9b807e5 100644 > --- a/linux-user/main.c > +++ b/linux-user/main.c > @@ -2216,6 +2216,7 @@ static void usage(void) > interp_prefix, > x86_stack_size, > DEBUG_LOGFILE); > + fflush(stdout); > _exit(1); > } > >