summaryrefslogtreecommitdiff
path: root/shell/ash.c
diff options
context:
space:
mode:
Diffstat (limited to 'shell/ash.c')
-rw-r--r--shell/ash.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 70ee15e..60c8ffe 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -13268,6 +13268,7 @@ readcmd(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
/* "read -s" needs to save/restore termios, can't allow ^C
* to jump out of it.
*/
+ again:
INT_OFF;
r = shell_builtin_read(setvar0,
argptr,
@@ -13280,6 +13281,12 @@ readcmd(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
);
INT_ON;
+ if ((uintptr_t)r == 1 && errno == EINTR) {
+ /* to get SIGCHLD: sleep 1 & read x; echo $x */
+ if (pending_sig == 0)
+ goto again;
+ }
+
if ((uintptr_t)r > 1)
ash_msg_and_raise_error(r);