← Commit list

4ea0ca819

Denys Vlasenko
Denys Vlasenko
2009-09-25
FAILED Duration: 36s

Subject

hush: document a TODO. no code changes

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

shell/hush.c+10 -2
@@ -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);