mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-30 01:44:37 +00:00
check waitpid() return value before setting exitStatus
This fixes a race with parallelBuild on DragonFly BSD.
This commit is contained in:
@@ -965,7 +965,7 @@ elif not defined(useNimRtl):
|
||||
var ret : int
|
||||
var status : cint = 1
|
||||
ret = waitpid(p.id, status, WNOHANG)
|
||||
if WIFEXITED(status):
|
||||
if ret == int(p.id) and WIFEXITED(status):
|
||||
p.exitStatus = status
|
||||
if ret == 0: return true # Can't establish status. Assume running.
|
||||
result = ret == int(p.id)
|
||||
|
||||
Reference in New Issue
Block a user