From ea535ed1ff1070b210bfc4ab9bc4159d3f20c345 Mon Sep 17 00:00:00 2001 From: Araq Date: Wed, 25 Oct 2017 13:33:19 +0200 Subject: osproc on Windows: fix peekExitCode for closed processes --- lib/pure/osproc.nim | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/pure/osproc.nim') diff --git a/lib/pure/osproc.nim b/lib/pure/osproc.nim index 07429b9a9..15ffbf5de 100644 --- a/lib/pure/osproc.nim +++ b/lib/pure/osproc.nim @@ -617,6 +617,7 @@ when defined(Windows) and not defined(useNimRtl): var res: int32 discard getExitCodeProcess(p.fProcessHandle, res) result = res + p.exitStatus = res discard closeHandle(p.fProcessHandle) proc peekExitCode(p: Process): int = @@ -625,6 +626,7 @@ when defined(Windows) and not defined(useNimRtl): else: var res: int32 discard getExitCodeProcess(p.fProcessHandle, res) + if res == 0: return p.exitStatus return res proc inputStream(p: Process): Stream = -- cgit 1.4.1-2-gfad0 From c4dcbb45f4cbc6e962ea841d5656156aa55eff95 Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Thu, 26 Oct 2017 09:19:18 +0200 Subject: osproc.execProcesses: enable poParentStreams for posix; should make travis green again --- lib/pure/osproc.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/pure/osproc.nim') diff --git a/lib/pure/osproc.nim b/lib/pure/osproc.nim index 15ffbf5de..71d3d9c72 100644 --- a/lib/pure/osproc.nim +++ b/lib/pure/osproc.nim @@ -280,7 +280,7 @@ proc execProcesses*(cmds: openArray[string], ## executes the commands `cmds` in parallel. Creates `n` processes ## that execute in parallel. The highest return value of all processes ## is returned. Runs `beforeRunEvent` before running each command. - when defined(posix): + when false: # poParentStreams causes problems on Posix, so we simply disable it: var options = options - {poParentStreams} -- cgit 1.4.1-2-gfad0