aboutsummaryrefslogtreecommitdiff
path: root/gdb/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/main.c')
-rw-r--r--gdb/main.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/gdb/main.c b/gdb/main.c
index 1c240e4..11f4b03 100644
--- a/gdb/main.c
+++ b/gdb/main.c
@@ -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);