diff --git a/bin/sh/jobs.c b/bin/sh/jobs.c index db13855b4222..2fd7aaa4e7d6 100644 --- a/bin/sh/jobs.c +++ b/bin/sh/jobs.c @@ -966,13 +966,8 @@ dowait(int block, struct job *job) sig = WTERMSIG(status); } if (sig != 0 && sig != SIGINT && sig != SIGPIPE) { - if (jp->foreground) { -#if JOBS - if (WIFSTOPPED(status)) - i = WSTOPSIG(status); - else -#endif - i = WTERMSIG(status); + if (thisjob->foreground && !WIFSTOPPED(status)) { + i = WTERMSIG(status); if ((i & 0x7F) < NSIG && sys_siglist[i & 0x7F]) out1str(sys_siglist[i & 0x7F]); else