diff options
| author | Paul Eggert | 2019-06-20 00:37:52 -0700 |
|---|---|---|
| committer | Paul Eggert | 2019-06-20 00:41:13 -0700 |
| commit | 920745eba2d6cd094da5d7958299c8a1556e78d4 (patch) | |
| tree | d94d51eaed87f42bfb7220b7952b17fd92861ab6 | |
| parent | 2dbe05d01a0ce216fa1266074df162ddcd9f9d75 (diff) | |
| download | emacs-920745eba2d6cd094da5d7958299c8a1556e78d4.tar.gz emacs-920745eba2d6cd094da5d7958299c8a1556e78d4.zip | |
Simplify stdout buffering
* src/sysdep.c (_sobuf): Remove; we no longer need this
microoptimization.
(init_sys_modes): Simplify by assuming setvbuf.
| -rw-r--r-- | src/sysdep.c | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/src/sysdep.c b/src/sysdep.c index 3396764d5dc..dd1184aa456 100644 --- a/src/sysdep.c +++ b/src/sysdep.c | |||
| @@ -1073,16 +1073,6 @@ emacs_set_tty (int fd, struct emacs_tty *settings, bool flushp) | |||
| 1073 | static int old_fcntl_owner[FD_SETSIZE]; | 1073 | static int old_fcntl_owner[FD_SETSIZE]; |
| 1074 | #endif /* F_SETOWN */ | 1074 | #endif /* F_SETOWN */ |
| 1075 | 1075 | ||
| 1076 | /* This may also be defined in stdio, | ||
| 1077 | but if so, this does no harm, | ||
| 1078 | and using the same name avoids wasting the other one's space. */ | ||
| 1079 | |||
| 1080 | #if defined (USG) | ||
| 1081 | unsigned char _sobuf[BUFSIZ+8]; | ||
| 1082 | #else | ||
| 1083 | char _sobuf[BUFSIZ]; | ||
| 1084 | #endif | ||
| 1085 | |||
| 1086 | /* Initialize the terminal mode on all tty devices that are currently | 1076 | /* Initialize the terminal mode on all tty devices that are currently |
| 1087 | open. */ | 1077 | open. */ |
| 1088 | 1078 | ||
| @@ -1302,14 +1292,7 @@ init_sys_modes (struct tty_display_info *tty_out) | |||
| 1302 | } | 1292 | } |
| 1303 | #endif /* F_GETOWN */ | 1293 | #endif /* F_GETOWN */ |
| 1304 | 1294 | ||
| 1305 | #ifdef _IOFBF | 1295 | setvbuf (tty_out->output, NULL, _IOFBF, BUFSIZ); |
| 1306 | /* This symbol is defined on recent USG systems. | ||
| 1307 | Someone says without this call USG won't really buffer the file | ||
| 1308 | even with a call to setbuf. */ | ||
| 1309 | setvbuf (tty_out->output, (char *) _sobuf, _IOFBF, sizeof _sobuf); | ||
| 1310 | #else | ||
| 1311 | setbuf (tty_out->output, (char *) _sobuf); | ||
| 1312 | #endif | ||
| 1313 | 1296 | ||
| 1314 | if (tty_out->terminal->set_terminal_modes_hook) | 1297 | if (tty_out->terminal->set_terminal_modes_hook) |
| 1315 | tty_out->terminal->set_terminal_modes_hook (tty_out->terminal); | 1298 | tty_out->terminal->set_terminal_modes_hook (tty_out->terminal); |