Re: [PATCH] Unbuffer stdout and stderr on windows

Pedro Alves
2013-08-16T15:10:19Z

On 08/16/2013 03:57 PM, Eli Zaretskii wrote:
>> Date: Fri, 16 Aug 2013 15:21:50 +0100
>> From: Pedro Alves <palves@redhat.com>
>> CC: yao@codesourcery.com, gdb-patches@sourceware.org, brobecker@adacore.com
>>
>> On 08/16/2013 03:03 PM, Eli Zaretskii wrote:
>>
>>> I suggest not to broaden the issue beyond the original problem, lest
>>> we will be unable to solve it.
>>
>> Nobody's doing that. What I'm saying is that the testsuite is not
>> special, and we should _zone in_ to the real problem, and fix it
>> completely.
>
> A complete solution, if it exists, might require much more effort,

I don't think it does.

- First, make stderr always unbuffered. That's what you get on
most platforms anyway.
- Then, somewhere along fputs_unfiltered or some central output routine,
keep track of which was the last to be used between stdout and stderr.
If outputting to stderr, flush stdout first. Don't need to do the
opposite, since stderr will always be unbuffered.

--
Pedro Alves