diff src/lread.c @ 8083:dc62b2daf48e

(readchar): Restart interrupted I/O.
author Karl Heuer <kwzh@gnu.org>
date Tue, 28 Jun 1994 21:51:12 +0000
parents 1d65b2152c4e
children 94f524e0d5cd
line wrap: on
line diff
--- a/src/lread.c	Tue Jun 28 20:24:38 1994 +0000
+++ b/src/lread.c	Tue Jun 28 21:51:12 1994 +0000
@@ -25,6 +25,7 @@
 #include <sys/stat.h>
 #include <sys/file.h>
 #include <ctype.h>
+#include <errno.h>
 #include "lisp.h"
 
 #ifndef standalone
@@ -59,6 +60,8 @@
 #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 @@
       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)
     {