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:
Martin Cracauer 2004-02-05 22:34:05 +00:00
parent b77a54a688
commit e637898ea8
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=125501

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;