summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bin/sh/jobs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bin/sh/jobs.c b/bin/sh/jobs.c
index 36b075c3b95b..1c7983543815 100644
--- a/bin/sh/jobs.c
+++ b/bin/sh/jobs.c
@@ -926,7 +926,7 @@ dowait(int block, struct job *job)
pid = waitproc(block, &status);
TRACE(("wait returns %d, status=%d\n", (int)pid, status));
} while ((pid == -1 && errno == EINTR && breakwaitcmd == 0) ||
- (WIFSTOPPED(status) && !iflag));
+ (pid > 0 && WIFSTOPPED(status) && !iflag));
in_dowait--;
if (breakwaitcmd != 0) {
breakwaitcmd = 0;