Make peekExitCode on Posix use WIFEXITED to determine exit
This fixes #2552
This commit is contained in:
parent
28ecf72f79
commit
2025a0f482
1 changed files with 7 additions and 7 deletions
|
|
@ -883,7 +883,7 @@ elif not defined(useNimRtl):
|
||||||
var ret = waitpid(p.id, p.exitCode, WNOHANG)
|
var ret = waitpid(p.id, p.exitCode, WNOHANG)
|
||||||
var b = ret == int(p.id)
|
var b = ret == int(p.id)
|
||||||
if b: result = -1
|
if b: result = -1
|
||||||
if p.exitCode == -3: result = -1
|
if not WIFEXITED(p.exitCode): result = -1
|
||||||
else: result = p.exitCode.int shr 8
|
else: result = p.exitCode.int shr 8
|
||||||
|
|
||||||
proc createStream(stream: var Stream, handle: var FileHandle,
|
proc createStream(stream: var Stream, handle: var FileHandle,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue