[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 920745e 5/5: Simplify stdout buffering
From: |
Paul Eggert |
Subject: |
[Emacs-diffs] master 920745e 5/5: Simplify stdout buffering |
Date: |
Thu, 20 Jun 2019 03:41:20 -0400 (EDT) |
branch: master
commit 920745eba2d6cd094da5d7958299c8a1556e78d4
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>
Simplify stdout buffering
* src/sysdep.c (_sobuf): Remove; we no longer need this
microoptimization.
(init_sys_modes): Simplify by assuming setvbuf.
---
src/sysdep.c | 19 +------------------
1 file changed, 1 insertion(+), 18 deletions(-)
diff --git a/src/sysdep.c b/src/sysdep.c
index 3396764..dd1184a 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -1073,16 +1073,6 @@ emacs_set_tty (int fd, struct emacs_tty *settings, bool
flushp)
static int old_fcntl_owner[FD_SETSIZE];
#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
open. */
@@ -1302,14 +1292,7 @@ init_sys_modes (struct tty_display_info *tty_out)
}
#endif /* F_GETOWN */
-#ifdef _IOFBF
- /* 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
+ setvbuf (tty_out->output, NULL, _IOFBF, BUFSIZ);
if (tty_out->terminal->set_terminal_modes_hook)
tty_out->terminal->set_terminal_modes_hook (tty_out->terminal);