diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2021-11-30 16:50:05 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-11-30 16:50:05 -0500 |
| commit | ce12e1d64d6b0b62609f061d3773a7e8b35849c3 (patch) | |
| tree | 72da79208edff4fdebfc32db759ecca21716c260 /source/core/unix | |
| parent | ace4e334bc5fb299d2890b5e3f35dfd84ea32606 (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/unix')
| -rw-r--r-- | source/core/unix/slang-unix-process.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/source/core/unix/slang-unix-process.cpp b/source/core/unix/slang-unix-process.cpp index 4e8344486..2c84ef08f 100644 --- a/source/core/unix/slang-unix-process.cpp +++ b/source/core/unix/slang-unix-process.cpp @@ -435,12 +435,12 @@ static const int kCannotExecute = 126; ::close(stderrPipe[1]); ::close(stdinPipe[0]); - RefPtr<Stream> streams[Index(Process::StreamType::CountOf)]; + RefPtr<Stream> streams[Index(StdStreamType::CountOf)]; // Previously code didn't need to close, so we'll make stream not own the handles - streams[Index(Process::StreamType::StdOut)] = new UnixPipeStream(stdoutPipe[0], FileAccess::Read, true); - streams[Index(Process::StreamType::ErrorOut)] = new UnixPipeStream(stderrPipe[0], FileAccess::Read, true); - streams[Index(Process::StreamType::StdIn)] = new UnixPipeStream(stdinPipe[1], FileAccess::Write, true); + streams[Index(StdStreamType::Out)] = new UnixPipeStream(stdoutPipe[0], FileAccess::Read, true); + streams[Index(StdStreamType::ErrorOut)] = new UnixPipeStream(stderrPipe[0], FileAccess::Read, true); + streams[Index(StdStreamType::In)] = new UnixPipeStream(stdinPipe[1], FileAccess::Write, true); outProcess = new UnixProcess(childPid, streams[0].readRef()); return SLANG_OK; @@ -481,21 +481,21 @@ static const int kCannotExecute = 126; nanosleep(&timeSpec, nullptr); } -/* 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 UnixPipeStream(STDIN_FILENO, FileAccess::Read, false); break; } - case StreamType::StdOut: + case StdStreamType::Out: { out = new UnixPipeStream(STDOUT_FILENO, FileAccess::Write, false); break; } - case StreamType::ErrorOut: + case StdStreamType::ErrorOut: { out = new UnixPipeStream(STDERR_FILENO, FileAccess::Write, false); break; |
