diff options
author | Karl Heuer <kwzh@gnu.org> | 1994-06-28 21:51:12 +0000 |
---|---|---|
committer | Karl Heuer <kwzh@gnu.org> | 1994-06-28 21:51:12 +0000 |
commit | 27b6cd736e437c202ded9bb166996198413b5703 (patch) | |
tree | 75e3717f95f335ca29ef6b70eff22eddf6682035 | |
parent | 6cacd408bd9dfa0a1c1dbccfb270aacd7c4a54e2 (diff) | |
download | emacs-27b6cd736e437c202ded9bb166996198413b5703.tar.gz |
(readchar): Restart interrupted I/O.
-rw-r--r-- | src/lread.c | 16 |
1 files changed, 15 insertions, 1 deletions
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 <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) { |