diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2011-02-14 19:17:10 +0300 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2011-02-14 19:17:10 +0300 |
commit | 7c6f2468ccc849c9f8401ee97a3d894d8f483773 (patch) | |
tree | 39c358e7bc5758c691516146e4795353e126e1e8 /shell/hush.c | |
parent | b9348440b0491b479457b304754bca4840286f74 (diff) |
hush: do not print killer signal's name for SIGPIPE
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/hush.c')
-rw-r--r-- | shell/hush.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/shell/hush.c b/shell/hush.c index 00ef361cd..4d9e5f8c7 100644 --- a/shell/hush.c +++ b/shell/hush.c @@ -6504,13 +6504,15 @@ static int checkjobs(struct pipe *fg_pipe) fg_pipe->alive_cmds--; ex = WEXITSTATUS(status); /* bash prints killer signal's name for *last* - * process in pipe (prints just newline for SIGINT). + * process in pipe (prints just newline for SIGINT/SIGPIPE). * Mimic this. Example: "sleep 5" + (^\ or kill -QUIT) */ if (WIFSIGNALED(status)) { int sig = WTERMSIG(status); if (i == fg_pipe->num_cmds-1) - printf("%s\n", sig == SIGINT ? "" : get_signame(sig)); + /* TODO: use strsignal() instead for bash compat? but that's bloat... */ + printf("%s\n", sig == SIGINT || sig == SIGPIPE ? "" : get_signame(sig)); + /* TODO: if (WCOREDUMP(status)) + " (core dumped)"; */ /* TODO: MIPS has 128 sigs (1..128), what if sig==128 here? * Maybe we need to use sig | 128? */ ex = sig + 128; |