diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2011-02-14 17:17:10 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2011-02-14 17:17:10 +0100 |
commit | 7c6f2468ccc849c9f8401ee97a3d894d8f483773 (patch) | |
tree | 39c358e7bc5758c691516146e4795353e126e1e8 | |
parent | b9348440b0491b479457b304754bca4840286f74 (diff) | |
download | busybox-w32-7c6f2468ccc849c9f8401ee97a3d894d8f483773.tar.gz busybox-w32-7c6f2468ccc849c9f8401ee97a3d894d8f483773.tar.bz2 busybox-w32-7c6f2468ccc849c9f8401ee97a3d894d8f483773.zip |
hush: do not print killer signal's name for SIGPIPE
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | shell/ash.c | 1 | ||||
-rw-r--r-- | shell/hush.c | 6 |
2 files changed, 5 insertions, 2 deletions
diff --git a/shell/ash.c b/shell/ash.c index aaf21cd6f..cccd6dd79 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -3892,6 +3892,7 @@ sprint_status(char *s, int status, int sigonly) | |||
3892 | #endif | 3892 | #endif |
3893 | } | 3893 | } |
3894 | st &= 0x7f; | 3894 | st &= 0x7f; |
3895 | //TODO: use bbox's get_signame? strsignal adds ~600 bytes to text+rodata | ||
3895 | col = fmtstr(s, 32, strsignal(st)); | 3896 | col = fmtstr(s, 32, strsignal(st)); |
3896 | if (WCOREDUMP(status)) { | 3897 | if (WCOREDUMP(status)) { |
3897 | col += fmtstr(s + col, 16, " (core dumped)"); | 3898 | col += fmtstr(s + col, 16, " (core dumped)"); |
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) | |||
6504 | fg_pipe->alive_cmds--; | 6504 | fg_pipe->alive_cmds--; |
6505 | ex = WEXITSTATUS(status); | 6505 | ex = WEXITSTATUS(status); |
6506 | /* bash prints killer signal's name for *last* | 6506 | /* bash prints killer signal's name for *last* |
6507 | * process in pipe (prints just newline for SIGINT). | 6507 | * process in pipe (prints just newline for SIGINT/SIGPIPE). |
6508 | * Mimic this. Example: "sleep 5" + (^\ or kill -QUIT) | 6508 | * Mimic this. Example: "sleep 5" + (^\ or kill -QUIT) |
6509 | */ | 6509 | */ |
6510 | if (WIFSIGNALED(status)) { | 6510 | if (WIFSIGNALED(status)) { |
6511 | int sig = WTERMSIG(status); | 6511 | int sig = WTERMSIG(status); |
6512 | if (i == fg_pipe->num_cmds-1) | 6512 | if (i == fg_pipe->num_cmds-1) |
6513 | printf("%s\n", sig == SIGINT ? "" : get_signame(sig)); | 6513 | /* TODO: use strsignal() instead for bash compat? but that's bloat... */ |
6514 | printf("%s\n", sig == SIGINT || sig == SIGPIPE ? "" : get_signame(sig)); | ||
6515 | /* TODO: if (WCOREDUMP(status)) + " (core dumped)"; */ | ||
6514 | /* TODO: MIPS has 128 sigs (1..128), what if sig==128 here? | 6516 | /* TODO: MIPS has 128 sigs (1..128), what if sig==128 here? |
6515 | * Maybe we need to use sig | 128? */ | 6517 | * Maybe we need to use sig | 128? */ |
6516 | ex = sig + 128; | 6518 | ex = sig + 128; |