From 6a8fae4553997be1e56b4c733f31b0329d46de4d Mon Sep 17 00:00:00 2001 From: cracauer Date: Thu, 5 Feb 2004 22:34:05 +0000 Subject: Commit fix sent by Tor Egge 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...). --- bin/sh/jobs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bin/sh/jobs.c') 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; -- cgit v1.1