[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] flush stdout after printing usage()
From: |
Riku Voipio |
Subject: |
Re: [Qemu-devel] [PATCH] flush stdout after printing usage() |
Date: |
Wed, 28 Jan 2009 23:06:39 +0200 |
User-agent: |
Mutt/1.5.11+cvs20060126 |
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 <address@hidden>
> >---
> > 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