This is the mail archive of the
mailing list for the Cygwin project.
Re: [Patch] cygcheck: eprintf + display_error: Do more.
- From: Christopher Faylor <cgf-no-personal-reply-please at cygwin dot com>
- To: cygwin-patches at cygwin dot com
- Date: Thu, 18 Nov 2004 10:22:06 -0500
- Subject: Re: [Patch] cygcheck: eprintf + display_error: Do more.
- References: <firstname.lastname@example.org>
- Reply-to: cygwin-patches at cygwin dot com
On Thu, Nov 18, 2004 at 09:52:04AM +0100, Bas van Gompel wrote:
>This patch enables eprintf. It also causes stdout and stderr to be
>synchronzied (using fflush) when they refer to the same file-descriptor.
>Also, when stdout and stderr have a different number, and stdout is not
>a tty, the error-message is copied to stdout, allowing it to be easily
>captured in a cygcheck.out.
>(I'm aware that generally it is a bad idea to do things like this, but
>cygcheck being what it is, I think this ought to be an exception.)
I think the generally bad idea is a bad idea for a reason.
If we are going to redirect stuff like this, why not just forego the use
of stderr entirely and use stdout for all messages?
Also, rather than explicitly flushing, why not just set setbuf (stdout, NULL)
setbuf (stderr, NULL) in main()?