diff options
author | Johannes Schindelin | 2017-07-14 22:25:58 +0200 |
---|---|---|
committer | Denys Vlasenko | 2017-07-18 19:20:58 +0200 |
commit | 1f684bcde457d41f2dcb4451df27323924e13b68 (patch) | |
tree | 025ebb3515e670dd7caf39906a86abe4fddf26b9 | |
parent | 2cb72bb8de5587d0c6a9f1065f41aee962f196d4 (diff) | |
download | busybox-1f684bcde457d41f2dcb4451df27323924e13b68.zip busybox-1f684bcde457d41f2dcb4451df27323924e13b68.tar.gz |
ash: protect WIFSTOPPED use with #if JOBS
This change fixes the build in setups where there are
no headers defining WIFSTOPPED and WSTOPSIG (where JOBS has to be
set to 0).
This partially reverts 4700fb5be (ash: make dowait() a bit more
readable. Logic is unchanged, 2015-10-09).
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | shell/ash.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/shell/ash.c b/shell/ash.c index 2e1d1e7..7a11305 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -4022,15 +4022,19 @@ sprint_status48(char *s, int status, int sigonly) col = 0; if (!WIFEXITED(status)) { - if (JOBS && WIFSTOPPED(status)) +#if JOBS + if (WIFSTOPPED(status)) st = WSTOPSIG(status); else +#endif st = WTERMSIG(status); if (sigonly) { if (st == SIGINT || st == SIGPIPE) goto out; - if (JOBS && WIFSTOPPED(status)) +#if JOBS + if (WIFSTOPPED(status)) goto out; +#endif } st &= 0x7f; //TODO: use bbox's get_signame? strsignal adds ~600 bytes to text+rodata @@ -4182,8 +4186,10 @@ dowait(int block, struct job *job) goto out; } /* The process wasn't found in job list */ - if (JOBS && !WIFSTOPPED(status)) +#if JOBS + if (!WIFSTOPPED(status)) jobless--; +#endif out: INT_ON; |