diff options
author | Johannes Hofmann <johannes.hofmann@gmx.de> | 2016-12-02 22:24:42 +0100 |
---|---|---|
committer | Johannes Hofmann <johannes.hofmann@gmx.de> | 2016-12-02 22:24:42 +0100 |
commit | b453a8e616f489e077f8edcd95623b07484e7b8b (patch) | |
tree | 95f9d4dbdcfebd82f5813346aa0a4b283c3cc656 /lib | |
parent | d6ab21eed53df590b25742c06ac4dff908d8b27d (diff) | |
download | Nim-b453a8e616f489e077f8edcd95623b07484e7b8b.tar.gz |
check waitpid() return value before setting exitStatus
This fixes a race with parallelBuild on DragonFly BSD.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pure/osproc.nim | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/pure/osproc.nim b/lib/pure/osproc.nim index 76bd2dfe1..f597bf773 100644 --- a/lib/pure/osproc.nim +++ b/lib/pure/osproc.nim @@ -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) |