* event-top.c (gdb_setup_readline): Call stderr_fileopen
	instead of stdio_fileopen.
	* main.c (captured_main) [__MINGW32__]: Set stderr unbuffered.
	.Call stderr_fileopen instead of stdio_fileopen.
	* ui-file.c [__MINGW32__] (stderr_file_write): New function.
	[__MINGW32__] (stderr_file_fputs): New function.
	(stderr_fileopen): New function.
	* ui-file.h (stderr_fileopen): Declare.
This commit is contained in:
Yao Qi
2013-08-28 12:25:05 +00:00
parent 7e10503172
commit ffa4ac956c
5 changed files with 79 additions and 2 deletions

View File

@@ -375,8 +375,15 @@ captured_main (void *data)
saved_command_line[0] = '\0';
instream = stdin;
#ifdef __MINGW32__
/* Ensure stderr is unbuffered. A Cygwin pty or pipe is implemented
as a Windows pipe, and Windows buffers on pipes. */
setvbuf (stderr, NULL, _IONBF, BUFSIZ);
#endif
gdb_stdout = stdio_fileopen (stdout);
gdb_stderr = stdio_fileopen (stderr);
gdb_stderr = stderr_fileopen ();
gdb_stdlog = gdb_stderr; /* for moment */
gdb_stdtarg = gdb_stderr; /* for moment */
gdb_stdin = stdio_fileopen (stdin);