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...).
This commit is contained in:
cracauer 2004-02-05 22:34:05 +00:00
parent b6bc039460
commit 6a8fae4553

View File

@ -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;