# HG changeset patch # User Karl Heuer # Date 772840272 0 # Node ID dc62b2daf48e5a5a1d735a7fac47b87d6d29508c # Parent 215cfbab6d725b97e85c6aa8d5d3f6d99ad31a3c (readchar): Restart interrupted I/O. diff -r 215cfbab6d72 -r dc62b2daf48e src/lread.c --- 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 #include #include +#include #include "lisp.h" #ifndef standalone @@ -59,6 +60,8 @@ #include #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) {