summaryrefslogtreecommitdiffstats
path: root/source/core/windows
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2021-11-30 16:50:05 -0500
committerGitHub <noreply@github.com>2021-11-30 16:50:05 -0500
commitce12e1d64d6b0b62609f061d3773a7e8b35849c3 (patch)
tree72da79208edff4fdebfc32db759ecca21716c260 /source/core/windows
parentace4e334bc5fb299d2890b5e3f35dfd84ea32606 (diff)
Auto flush for streams for stdin/out in slang-test (#2035)
* #include an absolute path didn't work - because paths were taken to always be relative. * Move StreamType from Process to StdStreamType in slang-stream.h * Disable buffering for stdout/stderr for slang-test. * Improve comment.
Diffstat (limited to 'source/core/windows')
-rw-r--r--source/core/windows/slang-win-process.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/source/core/windows/slang-win-process.cpp b/source/core/windows/slang-win-process.cpp
index ed06f5692..e0e38f2d4 100644
--- a/source/core/windows/slang-win-process.cpp
+++ b/source/core/windows/slang-win-process.cpp
@@ -120,7 +120,7 @@ public:
WinProcess(HANDLE handle, Stream* const* streams) :
m_processHandle(handle)
{
- for (Index i = 0; i < Index(Process::StreamType::CountOf); ++i)
+ for (Index i = 0; i < Index(StdStreamType::CountOf); ++i)
{
m_streams[i] = streams[i];
}
@@ -373,21 +373,21 @@ void WinProcess::kill(int32_t returnCode)
return UnownedStringSlice::fromLiteral(".exe");
}
-/* static */SlangResult Process::getStdStream(StreamType type, RefPtr<Stream>& out)
+/* static */SlangResult Process::getStdStream(StdStreamType type, RefPtr<Stream>& out)
{
switch (type)
{
- case StreamType::StdIn:
+ case StdStreamType::In:
{
out = new WinPipeStream(GetStdHandle(STD_INPUT_HANDLE), FileAccess::Read, false);
return SLANG_OK;
}
- case StreamType::StdOut:
+ case StdStreamType::Out:
{
out = new WinPipeStream(GetStdHandle(STD_OUTPUT_HANDLE), FileAccess::Write, false);
return SLANG_OK;
}
- case StreamType::ErrorOut:
+ case StdStreamType::ErrorOut:
{
out = new WinPipeStream(GetStdHandle(STD_ERROR_HANDLE), FileAccess::Write, false);
return SLANG_OK;
@@ -518,10 +518,10 @@ void WinProcess::kill(int32_t returnCode)
processHandle = processInfo.hProcess;
}
- RefPtr<Stream> streams[Index(Process::StreamType::CountOf)];
- streams[Index(Process::StreamType::ErrorOut)] = new WinPipeStream(childStdErrRead.detach(), FileAccess::Read);
- streams[Index(Process::StreamType::StdOut)] = new WinPipeStream(childStdOutRead.detach(), FileAccess::Read);
- streams[Index(Process::StreamType::StdIn)] = new WinPipeStream(childStdInWrite.detach(), FileAccess::Write);
+ RefPtr<Stream> streams[Index(StdStreamType::CountOf)];
+ 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);
outProcess = new WinProcess(processHandle.detach(), streams[0].readRef());
return SLANG_OK;