gdb/
[deliverable/binutils-gdb.git] / gdb / main.c
index 1c240e4d398e432529b3040a436d05bc65e3c4cf..11f4b03a3da2ea164d4b5dc2776b21320d515496 100644 (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);
This page took 0.024142 seconds and 4 git commands to generate.