From 35ddd9c4bae1956932dc45b4af48391ac71da0a2 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Mon, 11 Apr 2011 16:34:21 +0000 Subject: users/15953: handle EINTR when using read -k or -q with -u or -p --- ChangeLog | 10 +++++++++- Src/builtin.c | 13 ++++++++++--- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index e8c439bd3..cf1bfc19b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2011-04-11 Peter Stephenson + + * users/15953: Src/builtin.c: handle EINTR when using read -k or + -q together with -u or -p. + + * cat.in.136: users/15945: Completion/Redhat/Command/_yum: + various corrections and updates. + 2011-04-05 Wayne Davison * 28977: Src/utils.c: fix copying of uninitialized memory @@ -14425,5 +14433,5 @@ ***************************************************** * This is used by the shell to define $ZSH_PATCHLEVEL -* $Revision: 1.5241 $ +* $Revision: 1.5242 $ ***************************************************** diff --git a/Src/builtin.c b/Src/builtin.c index cda5e68cb..127d58bdb 100644 --- a/Src/builtin.c +++ b/Src/builtin.c @@ -5291,9 +5291,16 @@ bin_read(char *name, char **args, Options ops, UNUSED(int func)) *bptr = readchar; val = 1; readchar = -1; - } else if ((val = read(readfd, bptr, nchars)) <= 0) { - eof = 1; - break; + } else { + while ((val = read(readfd, bptr, nchars)) < 0) { + if (errno != EINTR || + errflag || retflag || breaks || contflag) + break; + } + if (val <= 0) { + eof = 1; + break; + } } #ifdef MULTIBYTE_SUPPORT -- cgit 1.4.1