Commit 920745eb authored by Paul Eggert's avatar Paul Eggert

Simplify stdout buffering

* src/sysdep.c (_sobuf): Remove; we no longer need this
microoptimization.
(init_sys_modes): Simplify by assuming setvbuf.
parent 2dbe05d0
Pipeline #2183 failed with stage
in 51 minutes and 13 seconds
...@@ -1073,16 +1073,6 @@ emacs_set_tty (int fd, struct emacs_tty *settings, bool flushp) ...@@ -1073,16 +1073,6 @@ emacs_set_tty (int fd, struct emacs_tty *settings, bool flushp)
static int old_fcntl_owner[FD_SETSIZE]; static int old_fcntl_owner[FD_SETSIZE];
#endif /* F_SETOWN */ #endif /* F_SETOWN */
/* This may also be defined in stdio,
but if so, this does no harm,
and using the same name avoids wasting the other one's space. */
#if defined (USG)
unsigned char _sobuf[BUFSIZ+8];
#else
char _sobuf[BUFSIZ];
#endif
/* Initialize the terminal mode on all tty devices that are currently /* Initialize the terminal mode on all tty devices that are currently
open. */ open. */
...@@ -1302,14 +1292,7 @@ init_sys_modes (struct tty_display_info *tty_out) ...@@ -1302,14 +1292,7 @@ init_sys_modes (struct tty_display_info *tty_out)
} }
#endif /* F_GETOWN */ #endif /* F_GETOWN */
#ifdef _IOFBF setvbuf (tty_out->output, NULL, _IOFBF, BUFSIZ);
/* This symbol is defined on recent USG systems.
Someone says without this call USG won't really buffer the file
even with a call to setbuf. */
setvbuf (tty_out->output, (char *) _sobuf, _IOFBF, sizeof _sobuf);
#else
setbuf (tty_out->output, (char *) _sobuf);
#endif
if (tty_out->terminal->set_terminal_modes_hook) if (tty_out->terminal->set_terminal_modes_hook)
tty_out->terminal->set_terminal_modes_hook (tty_out->terminal); tty_out->terminal->set_terminal_modes_hook (tty_out->terminal);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment