]> git.eshelyaron.com Git - emacs.git/commitdiff
(readchar): Restart interrupted I/O.
authorKarl Heuer <kwzh@gnu.org>
Tue, 28 Jun 1994 21:51:12 +0000 (21:51 +0000)
committerKarl Heuer <kwzh@gnu.org>
Tue, 28 Jun 1994 21:51:12 +0000 (21:51 +0000)
src/lread.c

index 57a29ff6d4833528ecf6bc5d826f0646def63abe..2e8d135ba32306537b3723aacd8cb70f9211fa19 100644 (file)
@@ -25,6 +25,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include <sys/stat.h>
 #include <sys/file.h>
 #include <ctype.h>
+#include <errno.h>
 #include "lisp.h"
 
 #ifndef standalone
@@ -59,6 +60,8 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include <math.h>
 #endif /* LISP_FLOAT_TYPE */
 
+extern int errno;
+
 Lisp_Object Qread_char, Qget_file_char, Qstandard_input, Qcurrent_load_list;
 Lisp_Object Qvariable_documentation, Vvalues, Vstandard_input, Vafter_load_alist;
 Lisp_Object Qascii_character, Qload;
@@ -134,7 +137,18 @@ readchar (readcharfun)
       return c;
     }
   if (EQ (readcharfun, Qget_file_char))
-    return getc (instream);
+    {
+      c = getc (instream);
+#ifdef EINTR
+      /* Interrupted reads have been observed while reading over the network */
+      while (c == EOF && ferror (instream) && errno == EINTR)
+       {
+         clearerr (instream);
+         c = getc (instream);
+       }
+#endif
+      return c;
+    }
 
   if (XTYPE (readcharfun) == Lisp_String)
     {