From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LSHca-0000B9-Nj for qemu-devel@nongnu.org; Wed, 28 Jan 2009 16:06:52 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LSHcZ-00006s-4D for qemu-devel@nongnu.org; Wed, 28 Jan 2009 16:06:52 -0500 Received: from [199.232.76.173] (port=40049 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LSHcY-00006e-WC for qemu-devel@nongnu.org; Wed, 28 Jan 2009 16:06:51 -0500 Received: from [84.20.150.76] (port=35588 helo=narury.org) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LSHcY-0001Cm-G1 for qemu-devel@nongnu.org; Wed, 28 Jan 2009 16:06:50 -0500 Received: from kos.to (localhost.localdomain [127.0.0.1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by narury.org (Postfix) with ESMTP id F148E3274004 for ; Wed, 28 Jan 2009 23:06:39 +0200 (EET) Date: Wed, 28 Jan 2009 23:06:39 +0200 From: Riku Voipio Subject: Re: [Qemu-devel] [PATCH] flush stdout after printing usage() Message-ID: <20090128210639.GB4155@kos.to> References: <20090128184713.GA29581@kos.to> <4980BBC2.3050709@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4980BBC2.3050709@codemonkey.ws> 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 On Wed, Jan 28, 2009 at 02:10:42PM -0600, Anthony Liguori wrote: > 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()? Well yes in my testing, replacing _exit() with exit() fixes it too. I just presumed _exit() was there for a purpose. > 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); > > } > > > > > > -- "rm -rf" only sounds scary if you don't have backups