FreeBSD-specific code
This commit is contained in:
parent
e37e997868
commit
458e3b2f07
1 changed files with 8 additions and 4 deletions
|
|
@ -848,10 +848,14 @@ 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 status : cint = 1
|
var ret : int
|
||||||
var ret = waitpid(p.id, status, WNOHANG)
|
when not defined(freebsd):
|
||||||
if WIFEXITED(status):
|
ret = waitpid(p.id, p.exitCode, WNOHANG)
|
||||||
p.exitCode = status
|
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.
|
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