summaryrefslogtreecommitdiffstats
path: root/bin/sh/jobs.c
diff options
context:
space:
mode:
authorcracauer <cracauer@FreeBSD.org>2004-02-05 22:34:05 +0000
committercracauer <cracauer@FreeBSD.org>2004-02-05 22:34:05 +0000
commit6a8fae4553997be1e56b4c733f31b0329d46de4d (patch)
treeb2f155e96f55f44e66ec03b7b23fc89711243e11 /bin/sh/jobs.c
parentb6bc0394603ad2868043b362b9b165c9d1d42cb7 (diff)
downloadFreeBSD-src-6a8fae4553997be1e56b4c733f31b0329d46de4d.zip
FreeBSD-src-6a8fae4553997be1e56b4c733f31b0329d46de4d.tar.gz
Commit fix sent by Tor Egge <Tor.Egge@cvsup.no.freebsd.org>
Only use return value from system call if system call succeeded. Tested with `make world` and some of my own scripts. This should be MFCed soon. While /bin/sh is hard to test the fix is obviously correct and can be assumed not to break something else (famous last words...).
Diffstat (limited to 'bin/sh/jobs.c')
-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 36b075c..1c79835 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;
OpenPOWER on IntegriCloud