reset p.exitCode in peekExitCode on Posix when process did not exit (#4793)
* reset p.exitCode in peekExitCode on Posix when process did not exit fixes #4792 * fix indentation
This commit is contained in:
parent
f4f8827c06
commit
93160547a9
1 changed files with 3 additions and 1 deletions
|
|
@ -1143,7 +1143,9 @@ 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 not WIFEXITED(p.exitCode): result = -1
|
if not WIFEXITED(p.exitCode):
|
||||||
|
p.exitCode = -3
|
||||||
|
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