From 2c1b5dbe280272ac103893d39825a57d6a059d60 Mon Sep 17 00:00:00 2001 From: Karl Heuer Date: Tue, 28 Jun 1994 21:51:12 +0000 Subject: [PATCH] (readchar): Restart interrupted I/O. --- src/lread.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/lread.c b/src/lread.c index 57a29ff6d48..2e8d135ba32 100644 --- a/src/lread.c +++ b/src/lread.c @@ -25,6 +25,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #include #include #include +#include #include "lisp.h" #ifndef standalone @@ -59,6 +60,8 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #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 @@ 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) { -- 2.39.5