diff options
author | Jari Aalto <jari.aalto@cante.net> | 1997-09-22 20:22:27 +0000 |
---|---|---|
committer | Jari Aalto <jari.aalto@cante.net> | 2009-09-12 16:46:51 +0000 |
commit | e8ce775db824de329b81293b4e5d8fbd65624528 (patch) | |
tree | 4b20c4dc766f5172b65ca1bc16ae1b6d48920fa1 /builtins/read.def | |
parent | d166f048818e10cf3799aa24a174fb22835f1acc (diff) | |
download | bash-e8ce775db824de329b81293b4e5d8fbd65624528.tar.gz |
Imported from ../bash-2.01.1.tar.gz.
Diffstat (limited to 'builtins/read.def')
-rw-r--r-- | builtins/read.def | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/builtins/read.def b/builtins/read.def index 64a4a11a..e1e63541 100644 --- a/builtins/read.def +++ b/builtins/read.def @@ -46,6 +46,8 @@ $END # include <unistd.h> #endif +#include <errno.h> + #include "../shell.h" #include "common.h" #include "bashgetopt.h" @@ -55,6 +57,10 @@ $END #include <readline/readline.h> #endif +#if !defined(errno) +extern int errno; +#endif + #define issep(c) (strchr (ifs_chars, (c))) extern int interrupt_immediately; @@ -180,8 +186,11 @@ read_builtin (list) c = rlbuf[rlind++]; } else -#endif - if (read (0, &c, 1) != 1) +#endif + + while (((retval = read (0, &c, 1)) < 0) && errno == EINTR) + ; + if (retval <= 0) { eof = 1; break; |