From: Paul Eggert Date: Thu, 20 Jun 2019 07:32:17 +0000 (-0700) Subject: Line-buffer stderr X-Git-Tag: emacs-27.0.90~2372 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2079e40a3cffbfacc79725c8788d56d05f232222;p=emacs.git Line-buffer stderr * src/sysdep.c (init_standard_fds) [!DOS_NT]: Use setvbuf to ensure stderr is line-buffered. --- diff --git a/src/sysdep.c b/src/sysdep.c index bc88e70dcb4..3396764d5dc 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -242,6 +242,12 @@ init_standard_fds (void) force_open (STDIN_FILENO, O_WRONLY); force_open (STDOUT_FILENO, O_RDONLY); force_open (STDERR_FILENO, O_RDONLY); + + /* Line-buffer stderr. However, leave stderr unbuffered on + MS-Windows, where setvbuf treats _IOLBF like _IOFBF. */ +#ifndef DOS_NT + setvbuf (stderr, NULL, _IOLBF, 0); +#endif } /* Return the current working directory. The result should be freed