mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-17 00:24:16 +00:00
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:
committed by
Dominik Picheta
parent
f4f8827c06
commit
93160547a9
@@ -1143,7 +1143,9 @@ elif not defined(useNimRtl):
|
||||
var ret = waitpid(p.id, p.exitCode, WNOHANG)
|
||||
var b = ret == int(p.id)
|
||||
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
|
||||
|
||||
proc createStream(stream: var Stream, handle: var FileHandle,
|
||||
|
||||
Reference in New Issue
Block a user