Re: [PATCH 2/3] Unbuffer stdout and stderr in cygwin

Eli Zaretskii
2013-07-29T15:42:19Z

> From: Yao Qi <yao@codesourcery.com>
> Date: Mon, 29 Jul 2013 16:45:45 +0800
>
> +#ifdef __MINGW32__
> + if (is_in_cygwin_p ())

I would suggest to call the function using_cygwin_pty or some such.
"is_in_cygwin" is IMO too ambiguous.

> + setvbuf (stdout, NULL, _IONBF, BUFSIZ);
> + setvbuf (stderr, NULL, _IONBF, BUFSIZ);

How about using line buffering instead on both streams? Or at least
leave stdout line-buffered? Did you try that, and if so, did that
have the same problems that triggered these patches?

You see, the way your patch works, using GDB from a Cygwin shell
window will always do the above, even when not running the test
suite. Users might be unhappy that their standard output suddenly
becomes much less efficient.