diff options
author | Johannes Hofmann <johannes.hofmann@gmx.de> | 2016-09-17 22:03:14 +0200 |
---|---|---|
committer | Dominik Picheta <dominikpicheta@googlemail.com> | 2016-09-17 22:03:14 +0200 |
commit | 93160547a92064e82ff070298b320b3c3abe8dbd (patch) | |
tree | f5a49e94642e6bebd7023d89d00ba9da65a4400f | |
parent | f4f8827c0633678ef5828d3b36a1ed645744a7fd (diff) | |
download | Nim-93160547a92064e82ff070298b320b3c3abe8dbd.tar.gz |
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
-rw-r--r-- | lib/pure/osproc.nim | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/pure/osproc.nim b/lib/pure/osproc.nim index 7378520e3..abc21b2b2 100644 --- a/lib/pure/osproc.nim +++ b/lib/pure/osproc.nim @@ -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, |