This is the mail archive of the cygwin-patches@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]