summaryrefslogtreecommitdiffstats
path: root/lldb/source/Host/posix/PipePosix.cpp
diff options
context:
space:
mode:
authorChaoren Lin <chaorenl@google.com>2015-04-29 17:36:58 +0000
committerChaoren Lin <chaorenl@google.com>2015-04-29 17:36:58 +0000
commita52f48412dd544816d308b6279ab51eb3f0b39f4 (patch)
tree5a7e61d85e1ea89d7bf980a80bf70159392010d6 /lldb/source/Host/posix/PipePosix.cpp
parent3eb4b4589e0094a39fa2e1a8b1e9f585b6cdaa69 (diff)
downloadbcm5719-llvm-a52f48412dd544816d308b6279ab51eb3f0b39f4.tar.gz
bcm5719-llvm-a52f48412dd544816d308b6279ab51eb3f0b39f4.zip
Add file descriptor constructor for PipePosix.
llvm-svn: 236133
Diffstat (limited to 'lldb/source/Host/posix/PipePosix.cpp')
-rw-r--r--lldb/source/Host/posix/PipePosix.cpp17
1 files changed, 4 insertions, 13 deletions
diff --git a/lldb/source/Host/posix/PipePosix.cpp b/lldb/source/Host/posix/PipePosix.cpp
index 1463b3a1396..5976ec60f6d 100644
--- a/lldb/source/Host/posix/PipePosix.cpp
+++ b/lldb/source/Host/posix/PipePosix.cpp
@@ -129,10 +129,10 @@ SelectIO(int handle, bool is_read, const std::function<Error(bool&)> &io_handler
}
PipePosix::PipePosix()
-{
- m_fds[READ] = PipePosix::kInvalidDescriptor;
- m_fds[WRITE] = PipePosix::kInvalidDescriptor;
-}
+ : m_fds{PipePosix::kInvalidDescriptor, PipePosix::kInvalidDescriptor} {}
+
+PipePosix::PipePosix(int read_fd, int write_fd)
+ : m_fds{read_fd, write_fd} {}
PipePosix::~PipePosix()
{
@@ -187,15 +187,6 @@ PipePosix::CreateNew(llvm::StringRef name, bool child_process_inherit)
}
Error
-PipePosix::CreateWithFD(int read_fd, int write_fd) {
- if (CanRead() || CanWrite())
- return Error("Pipe is already opened");
- m_fds[READ] = read_fd;
- m_fds[WRITE] = write_fd;
- return Error();
-}
-
-Error
PipePosix::CreateWithUniqueName(llvm::StringRef prefix, bool child_process_inherit, llvm::SmallVectorImpl<char>& name)
{
llvm::SmallString<PATH_MAX> named_pipe_path;
OpenPOWER on IntegriCloud