summaryrefslogtreecommitdiff
path: root/source/core/windows/slang-win-process.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2023-08-16 19:01:39 -0700
committerGitHub <noreply@github.com>2023-08-16 19:01:39 -0700
commit3e41d698714a3ab6235e9275d5e0687a1c5db9c9 (patch)
tree019635f444cb2efb320b7541ca3f341fbf191978 /source/core/windows/slang-win-process.cpp
parenteaeb7cf2913b884f9328433090242f8202e00699 (diff)
Run vk tests on spirv backend with expected failure list. (#3128)
Diffstat (limited to 'source/core/windows/slang-win-process.cpp')
-rw-r--r--source/core/windows/slang-win-process.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/source/core/windows/slang-win-process.cpp b/source/core/windows/slang-win-process.cpp
index 93bff3eb3..e577da0fa 100644
--- a/source/core/windows/slang-win-process.cpp
+++ b/source/core/windows/slang-win-process.cpp
@@ -419,8 +419,11 @@ void WinProcess::kill(int32_t returnCode)
WinHandle childStdInWriteTmp;
// create stdout pipe for child process
SLANG_RETURN_FAIL_ON_FALSE(CreatePipe(childStdOutReadTmp.writeRef(), childStdOutWrite.writeRef(), &securityAttributes, bufferSize));
- // create stderr pipe for child process
- SLANG_RETURN_FAIL_ON_FALSE(CreatePipe(childStdErrReadTmp.writeRef(), childStdErrWrite.writeRef(), &securityAttributes, bufferSize));
+ if ((flags & Process::Flag::DisableStdErrRedirection) == 0)
+ {
+ // create stderr pipe for child process
+ SLANG_RETURN_FAIL_ON_FALSE(CreatePipe(childStdErrReadTmp.writeRef(), childStdErrWrite.writeRef(), &securityAttributes, bufferSize));
+ }
// create stdin pipe for child process
SLANG_RETURN_FAIL_ON_FALSE(CreatePipe(childStdInRead.writeRef(), childStdInWriteTmp.writeRef(), &securityAttributes, bufferSize));
@@ -431,7 +434,8 @@ void WinProcess::kill(int32_t returnCode)
// create a non-inheritable duplicate of the stdout reader
SLANG_RETURN_FAIL_ON_FALSE(DuplicateHandle(currentProcess, childStdOutReadTmp, currentProcess, childStdOutRead.writeRef(), 0, FALSE, DUPLICATE_SAME_ACCESS));
// create a non-inheritable duplicate of the stderr reader
- SLANG_RETURN_FAIL_ON_FALSE(DuplicateHandle(currentProcess, childStdErrReadTmp, currentProcess, childStdErrRead.writeRef(), 0, FALSE, DUPLICATE_SAME_ACCESS));
+ if (childStdErrReadTmp)
+ SLANG_RETURN_FAIL_ON_FALSE(DuplicateHandle(currentProcess, childStdErrReadTmp, currentProcess, childStdErrRead.writeRef(), 0, FALSE, DUPLICATE_SAME_ACCESS));
// create a non-inheritable duplicate of the stdin writer
SLANG_RETURN_FAIL_ON_FALSE(DuplicateHandle(currentProcess, childStdInWriteTmp, currentProcess, childStdInWrite.writeRef(), 0, FALSE, DUPLICATE_SAME_ACCESS));
}
@@ -522,7 +526,8 @@ void WinProcess::kill(int32_t returnCode)
}
RefPtr<Stream> streams[Index(StdStreamType::CountOf)];
- streams[Index(StdStreamType::ErrorOut)] = new WinPipeStream(childStdErrRead.detach(), FileAccess::Read);
+ if (childStdErrRead)
+ streams[Index(StdStreamType::ErrorOut)] = new WinPipeStream(childStdErrRead.detach(), FileAccess::Read);
streams[Index(StdStreamType::Out)] = new WinPipeStream(childStdOutRead.detach(), FileAccess::Read);
streams[Index(StdStreamType::In)] = new WinPipeStream(childStdInWrite.detach(), FileAccess::Write);