summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko2009-09-25 12:58:37 +0200
committerDenys Vlasenko2009-09-25 12:58:37 +0200
commit4ea0ca81934ad62887632fa53d093b0048ea7e03 (patch)
treea7ad536b63a2410d124d15a4f5979a86c6b460a4
parent8f88d85e34fbcdff13ceffd2eb3d4ec8b998ddef (diff)
downloadbusybox-4ea0ca81934ad62887632fa53d093b0048ea7e03.zip
busybox-4ea0ca81934ad62887632fa53d093b0048ea7e03.tar.gz
hush: document a TODO. no code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--shell/hush.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/shell/hush.c b/shell/hush.c
index 866593f..00daf3d 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -1111,6 +1111,14 @@ static void restore_G_args(save_arg_t *sv, char **argv)
* Note: as a result, we do not use signal handlers much. The only uses
* are to count SIGCHLDs
* and to restore tty pgrp on signal-induced exit.
+ *
+ * TODO compat:
+ * Standard says "When a subshell is entered, traps that are not being ignored
+ * are set to the default actions". bash interprets it so that traps which
+ * are set to "" (ignore) are NOT reset to defaults. We reset them to default.
+ * bash example:
+ * # trap '' SYS; (bash -c 'kill -SYS $PPID'; echo YES)
+ * YES <-- subshell was not killed by SIGSYS
*/
enum {
SPECIAL_INTERACTIVE_SIGS = 0
@@ -3625,9 +3633,9 @@ static int checkjobs(struct pipe* fg_pipe)
/* Note: is WIFSIGNALED, WEXITSTATUS = sig + 128 */
rcode = WEXITSTATUS(status);
IF_HAS_KEYWORDS(if (fg_pipe->pi_inverted) rcode = !rcode;)
- /* bash prints killing signal's name for *last*
+ /* bash prints killer signal's name for *last*
* process in pipe (prints just newline for SIGINT).
- * Mimic this. Example: "sleep 5" + ^\
+ * Mimic this. Example: "sleep 5" + (^\ or kill -QUIT)
*/
if (WIFSIGNALED(status)) {
int sig = WTERMSIG(status);