summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2018-08-31 11:19:33 +0200
committerAraq <rumpf_a@web.de>2018-08-31 11:19:42 +0200
commitbacf08e65d614f515b0feb73e549090dce012f3f (patch)
tree46e3e7140302a1dc97f440cb3b37f6dd17c0ddf3 /lib
parent47c7fd037ed28b7de3d120b003d059d30e18f128 (diff)
downloadNim-bacf08e65d614f515b0feb73e549090dce012f3f.tar.gz
merged #8624 manually; fixes #8442; closes #8575
Diffstat (limited to 'lib')
-rw-r--r--lib/pure/osproc.nim6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/pure/osproc.nim b/lib/pure/osproc.nim
index f86acfc49..faeb01407 100644
--- a/lib/pure/osproc.nim
+++ b/lib/pure/osproc.nim
@@ -884,9 +884,11 @@ elif not defined(useNimRtl):
         chck posix_spawn_file_actions_adddup2(fops, data.pStdin[readIdx], readIdx)
         chck posix_spawn_file_actions_addclose(fops, data.pStdout[readIdx])
         chck posix_spawn_file_actions_adddup2(fops, data.pStdout[writeIdx], writeIdx)
-        if (poStdErrToStdOut in data.options):
-          chck posix_spawn_file_actions_addclose(fops, data.pStderr[readIdx])
+        chck posix_spawn_file_actions_addclose(fops, data.pStderr[readIdx])
+        if poStdErrToStdOut in data.options:
           chck posix_spawn_file_actions_adddup2(fops, data.pStdout[writeIdx], 2)
+        else:
+          chck posix_spawn_file_actions_adddup2(fops, data.pStderr[writeIdx], 2)
 
       var res: cint
       if data.workingDir.len > 0: