make osproc.execProcesses more robust
This commit is contained in:
parent
1975998c56
commit
f9b742c72a
1 changed files with 2 additions and 2 deletions
|
|
@ -306,7 +306,7 @@ proc execProcesses*(cmds: openArray[string],
|
||||||
raiseOSError(err)
|
raiseOSError(err)
|
||||||
|
|
||||||
if rexit >= 0:
|
if rexit >= 0:
|
||||||
result = max(result, q[rexit].peekExitCode())
|
result = max(result, abs(q[rexit].peekExitCode()))
|
||||||
if afterRunEvent != nil: afterRunEvent(rexit, q[rexit])
|
if afterRunEvent != nil: afterRunEvent(rexit, q[rexit])
|
||||||
close(q[rexit])
|
close(q[rexit])
|
||||||
if i < len(cmds):
|
if i < len(cmds):
|
||||||
|
|
@ -331,7 +331,7 @@ proc execProcesses*(cmds: openArray[string],
|
||||||
if beforeRunEvent != nil:
|
if beforeRunEvent != nil:
|
||||||
beforeRunEvent(i)
|
beforeRunEvent(i)
|
||||||
var p = startProcess(cmds[i], options=options + {poEvalCommand})
|
var p = startProcess(cmds[i], options=options + {poEvalCommand})
|
||||||
result = max(waitForExit(p), result)
|
result = max(abs(waitForExit(p)), result)
|
||||||
if afterRunEvent != nil: afterRunEvent(i, p)
|
if afterRunEvent != nil: afterRunEvent(i, p)
|
||||||
close(p)
|
close(p)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue