diff options
| author | Karl Heuer | 1994-06-28 21:51:12 +0000 |
|---|---|---|
| committer | Karl Heuer | 1994-06-28 21:51:12 +0000 |
| commit | 2c1b5dbe280272ac103893d39825a57d6a059d60 (patch) | |
| tree | ca4edc230d666db23c5372564ae81894b646c117 /src | |
| parent | 40ce92683ca3093a4f104f95a63cb549a9e9339d (diff) | |
| download | emacs-2c1b5dbe280272ac103893d39825a57d6a059d60.tar.gz emacs-2c1b5dbe280272ac103893d39825a57d6a059d60.zip | |
(readchar): Restart interrupted I/O.
Diffstat (limited to 'src')
| -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. */ | |||
| 25 | #include <sys/stat.h> | 25 | #include <sys/stat.h> |
| 26 | #include <sys/file.h> | 26 | #include <sys/file.h> |
| 27 | #include <ctype.h> | 27 | #include <ctype.h> |
| 28 | #include <errno.h> | ||
| 28 | #include "lisp.h" | 29 | #include "lisp.h" |
| 29 | 30 | ||
| 30 | #ifndef standalone | 31 | #ifndef standalone |
| @@ -59,6 +60,8 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ | |||
| 59 | #include <math.h> | 60 | #include <math.h> |
| 60 | #endif /* LISP_FLOAT_TYPE */ | 61 | #endif /* LISP_FLOAT_TYPE */ |
| 61 | 62 | ||
| 63 | extern int errno; | ||
| 64 | |||
| 62 | Lisp_Object Qread_char, Qget_file_char, Qstandard_input, Qcurrent_load_list; | 65 | Lisp_Object Qread_char, Qget_file_char, Qstandard_input, Qcurrent_load_list; |
| 63 | Lisp_Object Qvariable_documentation, Vvalues, Vstandard_input, Vafter_load_alist; | 66 | Lisp_Object Qvariable_documentation, Vvalues, Vstandard_input, Vafter_load_alist; |
| 64 | Lisp_Object Qascii_character, Qload; | 67 | Lisp_Object Qascii_character, Qload; |
| @@ -134,7 +137,18 @@ readchar (readcharfun) | |||
| 134 | return c; | 137 | return c; |
| 135 | } | 138 | } |
| 136 | if (EQ (readcharfun, Qget_file_char)) | 139 | if (EQ (readcharfun, Qget_file_char)) |
| 137 | return getc (instream); | 140 | { |
| 141 | c = getc (instream); | ||
| 142 | #ifdef EINTR | ||
| 143 | /* Interrupted reads have been observed while reading over the network */ | ||
| 144 | while (c == EOF && ferror (instream) && errno == EINTR) | ||
| 145 | { | ||
| 146 | clearerr (instream); | ||
| 147 | c = getc (instream); | ||
| 148 | } | ||
| 149 | #endif | ||
| 150 | return c; | ||
| 151 | } | ||
| 138 | 152 | ||
| 139 | if (XTYPE (readcharfun) == Lisp_String) | 153 | if (XTYPE (readcharfun) == Lisp_String) |
| 140 | { | 154 | { |