Fix compiler stuck on waiting C/CPP backends. (#7472)

This commit is contained in:
Eugene Kabanov 2018-04-02 22:54:27 +03:00 • committed by Andreas Rumpf
commit 0b99e8e8cb
2 changed files with 12 additions and 1 deletions

View file

@ -494,7 +494,7 @@ when defined(Windows) and not defined(useNimRtl):
sa.nLength = sizeof(SECURITY_ATTRIBUTES).cint
sa.lpSecurityDescriptor = nil
sa.bInheritHandle = 1
if createPipe(rdHandle, wrHandle, sa, 1024) == 0'i32:
if createPipe(rdHandle, wrHandle, sa, 0) == 0'i32:
raiseOSError(osLastError())
proc fileClose(h: Handle) {.inline.} =
@ -524,6 +524,12 @@ when defined(Windows) and not defined(useNimRtl):
he = ho
else:
createPipeHandles(he, si.hStdError)
if setHandleInformation(he, DWORD(1), DWORD(0)) == 0'i32:
raiseOsError(osLastError())
if setHandleInformation(hi, DWORD(1), DWORD(0)) == 0'i32:
raiseOsError(osLastError())
if setHandleInformation(ho, DWORD(1), DWORD(0)) == 0'i32:
raiseOsError(osLastError())
else:
createAllPipeHandles(si, hi, ho, he, cast[int](result))
result.inHandle = FileHandle(hi)