changeset 76777:846cbca78bc8

(readchar): Extend BLOCK_INPUT block to ferror/clearerr.
author YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
date Wed, 28 Mar 2007 08:16:19 +0000
parents 2bb28b957639
children d2f51c70bc85
files src/lread.c
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/lread.c	Wed Mar 28 08:16:05 2007 +0000
+++ b/src/lread.c	Wed Mar 28 08:16:19 2007 +0000
@@ -327,18 +327,18 @@
     {
       BLOCK_INPUT;
       c = getc (instream);
-      UNBLOCK_INPUT;
 #ifdef EINTR
       /* Interrupted reads have been observed while reading over the network */
       while (c == EOF && ferror (instream) && errno == EINTR)
 	{
+	  UNBLOCK_INPUT;
 	  QUIT;
-	  clearerr (instream);
 	  BLOCK_INPUT;
+	  clearerr (instream);
 	  c = getc (instream);
-	  UNBLOCK_INPUT;
 	}
 #endif
+      UNBLOCK_INPUT;
       return c;
     }