diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2009-09-25 12:58:37 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2009-09-25 12:58:37 +0200 |
commit | 4ea0ca81934ad62887632fa53d093b0048ea7e03 (patch) | |
tree | a7ad536b63a2410d124d15a4f5979a86c6b460a4 | |
parent | 8f88d85e34fbcdff13ceffd2eb3d4ec8b998ddef (diff) | |
download | busybox-w32-4ea0ca81934ad62887632fa53d093b0048ea7e03.tar.gz busybox-w32-4ea0ca81934ad62887632fa53d093b0048ea7e03.tar.bz2 busybox-w32-4ea0ca81934ad62887632fa53d093b0048ea7e03.zip |
hush: document a TODO. no code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | shell/hush.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/shell/hush.c b/shell/hush.c index 866593f77..00daf3ddd 100644 --- a/shell/hush.c +++ b/shell/hush.c | |||
@@ -1111,6 +1111,14 @@ static void restore_G_args(save_arg_t *sv, char **argv) | |||
1111 | * Note: as a result, we do not use signal handlers much. The only uses | 1111 | * Note: as a result, we do not use signal handlers much. The only uses |
1112 | * are to count SIGCHLDs | 1112 | * are to count SIGCHLDs |
1113 | * and to restore tty pgrp on signal-induced exit. | 1113 | * and to restore tty pgrp on signal-induced exit. |
1114 | * | ||
1115 | * TODO compat: | ||
1116 | * Standard says "When a subshell is entered, traps that are not being ignored | ||
1117 | * are set to the default actions". bash interprets it so that traps which | ||
1118 | * are set to "" (ignore) are NOT reset to defaults. We reset them to default. | ||
1119 | * bash example: | ||
1120 | * # trap '' SYS; (bash -c 'kill -SYS $PPID'; echo YES) | ||
1121 | * YES <-- subshell was not killed by SIGSYS | ||
1114 | */ | 1122 | */ |
1115 | enum { | 1123 | enum { |
1116 | SPECIAL_INTERACTIVE_SIGS = 0 | 1124 | SPECIAL_INTERACTIVE_SIGS = 0 |
@@ -3625,9 +3633,9 @@ static int checkjobs(struct pipe* fg_pipe) | |||
3625 | /* Note: is WIFSIGNALED, WEXITSTATUS = sig + 128 */ | 3633 | /* Note: is WIFSIGNALED, WEXITSTATUS = sig + 128 */ |
3626 | rcode = WEXITSTATUS(status); | 3634 | rcode = WEXITSTATUS(status); |
3627 | IF_HAS_KEYWORDS(if (fg_pipe->pi_inverted) rcode = !rcode;) | 3635 | IF_HAS_KEYWORDS(if (fg_pipe->pi_inverted) rcode = !rcode;) |
3628 | /* bash prints killing signal's name for *last* | 3636 | /* bash prints killer signal's name for *last* |
3629 | * process in pipe (prints just newline for SIGINT). | 3637 | * process in pipe (prints just newline for SIGINT). |
3630 | * Mimic this. Example: "sleep 5" + ^\ | 3638 | * Mimic this. Example: "sleep 5" + (^\ or kill -QUIT) |
3631 | */ | 3639 | */ |
3632 | if (WIFSIGNALED(status)) { | 3640 | if (WIFSIGNALED(status)) { |
3633 | int sig = WTERMSIG(status); | 3641 | int sig = WTERMSIG(status); |