diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2015-02-01 01:41:26 +0100 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2015-02-01 01:41:26 +0100 |
commit | 3b45ac44e16ffa5081cc8c0706d8af1c58df2660 (patch) | |
tree | 446b63a9cd37afad0b152c8305ac2943d35e0fad /lib/pure | |
parent | fa166dc42da4b171fd45800ef9cc6197fb34dff7 (diff) | |
parent | 458e3b2f07eea9a1f6d369cb10e7504f4e4d3855 (diff) | |
download | Nim-3b45ac44e16ffa5081cc8c0706d8af1c58df2660.tar.gz |
Merge pull request #2010 from modk/freebsd-parallel-build
Fix parallel build on FreeBSD
Diffstat (limited to 'lib/pure')
-rw-r--r-- | lib/pure/osproc.nim | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/pure/osproc.nim b/lib/pure/osproc.nim index 20a0c401e..6361dfb09 100644 --- a/lib/pure/osproc.nim +++ b/lib/pure/osproc.nim @@ -848,7 +848,14 @@ elif not defined(useNimRtl): if kill(p.id, SIGCONT) != 0'i32: raiseOsError(osLastError()) proc running(p: Process): bool = - var ret = waitpid(p.id, p.exitCode, WNOHANG) + var ret : int + when not defined(freebsd): + ret = waitpid(p.id, p.exitCode, WNOHANG) + else: + var status : cint = 1 + ret = waitpid(p.id, status, WNOHANG) + if WIFEXITED(status): + p.exitCode = status if ret == 0: return true # Can't establish status. Assume running. result = ret == int(p.id) |