check waitpid() return value before setting exitStatus
This fixes a race with parallelBuild on DragonFly BSD.
This commit is contained in:
parent
d6ab21eed5
commit
b453a8e616
1 changed files with 1 additions and 1 deletions
|
|
@ -965,7 +965,7 @@ elif not defined(useNimRtl):
|
||||||
var ret : int
|
var ret : int
|
||||||
var status : cint = 1
|
var status : cint = 1
|
||||||
ret = waitpid(p.id, status, WNOHANG)
|
ret = waitpid(p.id, status, WNOHANG)
|
||||||
if WIFEXITED(status):
|
if ret == int(p.id) and WIFEXITED(status):
|
||||||
p.exitStatus = status
|
p.exitStatus = status
|
||||||
if ret == 0: return true # Can't establish status. Assume running.
|
if ret == 0: return true # Can't establish status. Assume running.
|
||||||
result = ret == int(p.id)
|
result = ret == int(p.id)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue