diff options
author | 2018-05-22 12:56:38 -0700 | |
---|---|---|
committer | 2018-05-22 12:56:38 -0700 | |
commit | 7dfac44cb5e863bf8cdcfd040087c1667871ad2e (patch) | |
tree | 0023085540578c58e0967a5f5abbf175e816421a | |
parent | 98ad260f6b108068423288b946fddff36f6ce65d (diff) |
Use a pipe rather than a socketpair to collect debug information from
Treble HALs.
Bug: 79656374
Test: manually
Change-Id: I2c7a67c67bc8f99aff8efa9570acf82f474a8dc3
-rw-r--r-- | cmds/lshal/PipeRelay.cpp | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/cmds/lshal/PipeRelay.cpp b/cmds/lshal/PipeRelay.cpp index fc407495ca..3828bbf27f 100644 --- a/cmds/lshal/PipeRelay.cpp +++ b/cmds/lshal/PipeRelay.cpp @@ -16,7 +16,6 @@ #include "PipeRelay.h" -#include <sys/socket.h> #include <utils/Thread.h> namespace android { @@ -58,7 +57,7 @@ bool PipeRelay::RelayThread::threadLoop() { PipeRelay::PipeRelay(std::ostream &os) : mInitCheck(NO_INIT) { - int res = socketpair(AF_UNIX, SOCK_STREAM, 0 /* protocol */, mFds); + int res = pipe(mFds); if (res < 0) { mInitCheck = -errno; @@ -77,20 +76,13 @@ void PipeRelay::CloseFd(int *fd) { } PipeRelay::~PipeRelay() { - if (mFds[1] >= 0) { - shutdown(mFds[1], SHUT_WR); - } - - if (mFds[0] >= 0) { - shutdown(mFds[0], SHUT_RD); - } + CloseFd(&mFds[1]); if (mThread != NULL) { mThread->join(); mThread.clear(); } - CloseFd(&mFds[1]); CloseFd(&mFds[0]); } |