aboutsummaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorbug1 <bug1@69ca8d6d-28ef-0310-b511-8ec308f3f277>2003-09-15 14:42:39 +0000
committerbug1 <bug1@69ca8d6d-28ef-0310-b511-8ec308f3f277>2003-09-15 14:42:39 +0000
commitec3cb8c4691ec81549dee17829e7dd7a3d248851 (patch)
tree3a11af1cde739c63d4dbf8f1f15a7814d4a13d3b /shell
parentbea1942a5068cd1a2e83545d71c832ec58d6738d (diff)
downloadbusybox-w32-ec3cb8c4691ec81549dee17829e7dd7a3d248851.tar.gz
busybox-w32-ec3cb8c4691ec81549dee17829e7dd7a3d248851.tar.bz2
busybox-w32-ec3cb8c4691ec81549dee17829e7dd7a3d248851.zip
Patch from Bastian Blank to fix a problem when runing find under ash.
"If the shell is compiled with -DJOBS, this is all fine -- find wasn't stopped (it was killed), so it correctly uses WTERMSIG instead of WSTOPSIG. However, if the shell _isn't_ compiled with -DJOBS (which it isn't in d-i), only WSTOPSIG is used, which extracts the high byte instead of the low byte from the status code. Since the status code is 13 (SIGPIPE), "st" suddenly gets the value 0, which is equivalent to SIGEXIT. Thus, ash prints out "EXIT" on find's exit." git-svn-id: svn://busybox.net/trunk/busybox@7531 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'shell')
-rw-r--r--shell/ash.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 2146349ab..0cdfd2b1c 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -6683,10 +6683,10 @@ sprint_status(char *s, int status, int sigonly)
6683 col = 0; 6683 col = 0;
6684 st = WEXITSTATUS(status); 6684 st = WEXITSTATUS(status);
6685 if (!WIFEXITED(status)) { 6685 if (!WIFEXITED(status)) {
6686 st = WSTOPSIG(status); 6686 st = WTERMSIG(status);
6687#if JOBS 6687#if JOBS
6688 if (!WIFSTOPPED(status)) 6688 if (WIFSTOPPED(status))
6689 st = WTERMSIG(status); 6689 st = WSTOPSIG(status);
6690#endif 6690#endif
6691 if (sigonly) { 6691 if (sigonly) {
6692 if (st == SIGINT || st == SIGPIPE) 6692 if (st == SIGINT || st == SIGPIPE)