FreeBSD-specific code

This commit is contained in:
modk 2015-01-29 12:51:22 +01:00
commit 458e3b2f07

View file

@ -848,8 +848,12 @@ elif not defined(useNimRtl):
if kill(p.id, SIGCONT) != 0'i32: raiseOsError(osLastError()) if kill(p.id, SIGCONT) != 0'i32: raiseOsError(osLastError())
proc running(p: Process): bool = proc running(p: Process): bool =
var ret : int
when not defined(freebsd):
ret = waitpid(p.id, p.exitCode, WNOHANG)
else:
var status : cint = 1 var status : cint = 1
var ret = waitpid(p.id, status, WNOHANG) ret = waitpid(p.id, status, WNOHANG)
if WIFEXITED(status): if WIFEXITED(status):
p.exitCode = status p.exitCode = status
if ret == 0: return true # Can't establish status. Assume running. if ret == 0: return true # Can't establish status. Assume running.