summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--Src/Zle/zle_main.c14
2 files changed, 8 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index 0a021339d..08f53b631 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2014-11-25 Oliver Kiddle <opk@zsh.org>
+ * 33770: Src/Zle/zle_main.c: avoid calling identical FIONREAD
+ ioctl twice in succession
+
* users/19365 (credit Death Jester and Jan Larres):
Completion/Base/Completer/_external_pwds;
completer for current directory of other shell processes
diff --git a/Src/Zle/zle_main.c b/Src/Zle/zle_main.c
index d157e36c2..a38f55bfe 100644
--- a/Src/Zle/zle_main.c
+++ b/Src/Zle/zle_main.c
@@ -238,9 +238,9 @@ zsetterm(void)
* we can't set up the terminal for zle *at all* until
* we are sure there is no more typeahead to come. So
* if there is typeahead, we set the flag delayzsetterm.
- * Then getbyte() performs another FIONREAD call; if that is
- * 0, we have finally used up all the typeahead, and it is
- * safe to alter the terminal, which we do at that point.
+ * Then getbyte() calls here to performs another FIONREAD call;
+ * if that is 0, we have finally used up all the typeahead, and
+ * it is safe to alter the terminal, which we do at that point.
*/
delayzsetterm = 1;
return;
@@ -884,12 +884,8 @@ getbyte(long do_keytmout, int *timeout)
ret = STOUC(kungetbuf[--kungetct]);
else {
#ifdef FIONREAD
- if (delayzsetterm) {
- int val;
- ioctl(SHTTY, FIONREAD, (char *)&val);
- if (!val)
- zsetterm();
- }
+ if (delayzsetterm)
+ zsetterm();
#endif
for (;;) {
int q = queue_signal_level();