[Patch] cygcheck: eprintf + display_error: Do more.

Christopher Faylor cgf-no-personal-reply-please@cygwin.com
Thu Nov 18 15:21:00 GMT 2004


On Thu, Nov 18, 2004 at 09:52:04AM +0100, Bas van Gompel wrote:
>Hi,
>
>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()?

cgf



More information about the Cygwin-patches mailing list