diff options
author | Araq <rumpf_a@web.de> | 2017-01-07 03:05:48 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2017-01-07 03:05:48 +0100 |
commit | 92ecbc9958feb60b549a7d92116658e5ba2f041a (patch) | |
tree | 059f5050b6df0d870d7b14587b98e8fe7a1c542b /lib | |
parent | 7cd8b0b5e64d59e705add81bbff3b93bf121eae3 (diff) | |
download | Nim-92ecbc9958feb60b549a7d92116658e5ba2f041a.tar.gz |
fixes #5179
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pure/osproc.nim | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/pure/osproc.nim b/lib/pure/osproc.nim index 1d43bb321..fbcea4042 100644 --- a/lib/pure/osproc.nim +++ b/lib/pure/osproc.nim @@ -429,13 +429,14 @@ when defined(Windows) and not defined(useNimRtl): raiseOSError(osLastError()) proc createAllPipeHandles(si: var STARTUPINFO; - stdin, stdout, stderr: var Handle) = + stdin, stdout, stderr: var Handle; + hash: int) = var sa: SECURITY_ATTRIBUTES sa.nLength = sizeof(SECURITY_ATTRIBUTES).cint sa.lpSecurityDescriptor = nil sa.bInheritHandle = 1 - let pipeOutName = newWideCString(r"\\.\pipe\stdout") - let pipeInName = newWideCString(r"\\.\pipe\stdin") + let pipeOutName = newWideCString(r"\\.\pipe\stdout" & $hash) + let pipeInName = newWideCString(r"\\.\pipe\stdin" & $hash) let pipeOut = createNamedPipe(pipeOutName, dwOpenMode=PIPE_ACCESS_INBOUND or FILE_FLAG_WRITE_THROUGH, dwPipeMode=PIPE_NOWAIT, @@ -512,7 +513,7 @@ when defined(Windows) and not defined(useNimRtl): else: createPipeHandles(he, si.hStdError) else: - createAllPipeHandles(si, hi, ho, he) + createAllPipeHandles(si, hi, ho, he, cast[int](result)) result.inHandle = FileHandle(hi) result.outHandle = FileHandle(ho) result.errHandle = FileHandle(he) |