From 0eb0a887d83fae6b5ac2a8a92c2813cecd42ed96 Mon Sep 17 00:00:00 2001 From: Grzegorz Adam Hankiewicz Date: Sun, 27 Oct 2013 18:15:42 +0100 Subject: [PATCH] Fixes execProcesses wait order. Refs #379. Closing the stream of the process might terminate it too early for waitForExit to gather any useful results. --- lib/pure/osproc.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pure/osproc.nim b/lib/pure/osproc.nim index a3d72d73c7..754e34b850 100644 --- a/lib/pure/osproc.nim +++ b/lib/pure/osproc.nim @@ -236,8 +236,8 @@ proc execProcesses*(cmds: openArray[string], inc(i) if i > high(cmds): break for j in 0..m-1: - if q[j] != nil: close(q[j]) result = max(waitForExit(q[j]), result) + if q[j] != nil: close(q[j]) else: for i in 0..high(cmds): var p = startCmd(cmds[i], options=options)