about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBarton E. Schaefer <schaefer@zsh.org>2015-01-26 18:47:29 -0800
committerBarton E. Schaefer <schaefer@zsh.org>2015-01-26 18:48:25 -0800
commit5751de7975d559dbdf641126589683bd92fad9bc (patch)
tree50243f7bdf6f08db26314a56c407562b6a7b7660
parentcae0be3af69f32eee05028ca2ee0c4b6997171af (diff)
downloadzsh-5751de7975d559dbdf641126589683bd92fad9bc.tar.gz
zsh-5751de7975d559dbdf641126589683bd92fad9bc.tar.xz
zsh-5751de7975d559dbdf641126589683bd92fad9bc.zip
34403: refine 34399 to avoid settyinfo() when the input descriptor is not a TTY
-rw-r--r--ChangeLog5
-rw-r--r--Src/utils.c4
2 files changed, 7 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 5939ea141..a183c5086 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,11 @@
 	* 34387: Src/module.c: Avoid loading the main zsh binary as
 	a module
 
+2015-01-26  Barton E. Schaefer  <schaefer@zsh.org>
+
+	* 34403: Src/utils.c: refine 34399 to avoid settyinfo() when the
+	input descriptor is not a TTY
+
 2015-01-26  Peter Stephenson  <p.stephenson@samsung.com>
 
 	* 34402: Src/Modules/db_gdbm.c: make unsetting a tied gdbm
diff --git a/Src/utils.c b/Src/utils.c
index d38babbe4..47d99442d 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -2300,8 +2300,8 @@ read_poll(int fd, int *readchar, int polltty, zlong microseconds)
     struct ttyinfo ti;
 #endif
 
-     if (fd < 0)
-	 polltty = 0;		/* no tty to poll */
+    if (fd < 0 || (polltty && !isatty(fd)))
+	polltty = 0;		/* no tty to poll */
 
 #if defined(HAS_TIO) && !defined(__CYGWIN__)
     /*