diff options
Diffstat (limited to 'src/common/platform/unix/PosixSpawnSubProcess.cpp')
-rw-r--r-- | src/common/platform/unix/PosixSpawnSubProcess.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/common/platform/unix/PosixSpawnSubProcess.cpp b/src/common/platform/unix/PosixSpawnSubProcess.cpp index 6a8a8d0f..a356de77 100644 --- a/src/common/platform/unix/PosixSpawnSubProcess.cpp +++ b/src/common/platform/unix/PosixSpawnSubProcess.cpp @@ -2,11 +2,24 @@ #include "cru/common/SubProcess.h" #include <spawn.h> +#include <memory> namespace cru::platform::unix { PosixSpawnSubProcess::PosixSpawnSubProcess( const PlatformSubProcessStartInfo& start_info) - : PlatformSubProcessBase(start_info), pid_(0), exit_code_(0) {} + : PlatformSubProcessBase(start_info), + pid_(0), + exit_code_(0), + stdin_pipe_(UnixPipe::Usage::Send), + stdout_pipe_(UnixPipe::Usage::Receive), + stderr_pipe_(UnixPipe::Usage::Receive) { + stdin_stream_ = std::make_unique<UnixFileStream>( + stdin_pipe_.GetSelfFileDescriptor(), false, false, true, false); + stdout_stream_ = std::make_unique<UnixFileStream>( + stdout_pipe_.GetSelfFileDescriptor(), false, true, false, false); + stderr_stream_ = std::make_unique<UnixFileStream>( + stderr_pipe_.GetSelfFileDescriptor(), false, true, false, false); +} PosixSpawnSubProcess::~PosixSpawnSubProcess() {} |