diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2017-05-22 19:34:45 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2017-05-22 19:34:45 +0200 |
commit | f5470419404d643070db99d058405b714695b817 (patch) | |
tree | 7ed502471976679437b86f2e2cb38c14984f8a1e /shell/hush.c | |
parent | 0c63299b84513ff995413f820cb5f3d546c0c5d7 (diff) | |
download | busybox-w32-f5470419404d643070db99d058405b714695b817.tar.gz busybox-w32-f5470419404d643070db99d058405b714695b817.tar.bz2 busybox-w32-f5470419404d643070db99d058405b714695b817.zip |
ash,hush: fix SIGCHLD interrupting read builtin
function old new delta
readcmd 169 217 +48
shell_builtin_read 1087 1097 +10
localcmd 366 364 -2
builtin_read 197 193 -4
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/2 up/down: 58/-6) Total: 52 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/hush.c')
-rw-r--r-- | shell/hush.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/shell/hush.c b/shell/hush.c index e18920f50..125463a56 100644 --- a/shell/hush.c +++ b/shell/hush.c | |||
@@ -9038,6 +9038,9 @@ static int FAST_FUNC builtin_type(char **argv) | |||
9038 | * - terminates shell (regardless of interactivity); | 9038 | * - terminates shell (regardless of interactivity); |
9039 | * if it has non-empty trap: | 9039 | * if it has non-empty trap: |
9040 | * - executes trap and returns to read; | 9040 | * - executes trap and returns to read; |
9041 | * SIGCHLD from children: | ||
9042 | * - does not interrupt read regardless of interactivity: | ||
9043 | * try: sleep 1 & read x; echo $x | ||
9041 | */ | 9044 | */ |
9042 | static int FAST_FUNC builtin_read(char **argv) | 9045 | static int FAST_FUNC builtin_read(char **argv) |
9043 | { | 9046 | { |
@@ -9071,7 +9074,7 @@ static int FAST_FUNC builtin_read(char **argv) | |||
9071 | 9074 | ||
9072 | if ((uintptr_t)r == 1 && errno == EINTR) { | 9075 | if ((uintptr_t)r == 1 && errno == EINTR) { |
9073 | unsigned sig = check_and_run_traps(); | 9076 | unsigned sig = check_and_run_traps(); |
9074 | if (sig && sig != SIGINT) | 9077 | if (sig != SIGINT) |
9075 | goto again; | 9078 | goto again; |
9076 | } | 9079 | } |
9077 | 9080 | ||