All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] flush stdout after printing usage()
Date: Wed, 28 Jan 2009 14:10:42 -0600	[thread overview]
Message-ID: <4980BBC2.3050709@codemonkey.ws> (raw)
In-Reply-To: <20090128184713.GA29581@kos.to>

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 <riku.voipio@iki.fi>
> ---
>  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);
>  }
>  
>   

  reply	other threads:[~2009-01-28 20:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-28 18:47 [Qemu-devel] [PATCH] flush stdout after printing usage() Riku Voipio
2009-01-28 20:10 ` Anthony Liguori [this message]
2009-01-28 21:06   ` Riku Voipio
2009-01-28 21:51     ` Lionel Landwerlin
2009-01-28 22:00       ` Anthony Liguori
2009-02-06 14:33         ` Riku Voipio

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4980BBC2.3050709@codemonkey.ws \
    --to=anthony@codemonkey.ws \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.