diff options
author | 2023-11-21 07:53:05 +0000 | |
---|---|---|
committer | 2023-11-21 07:53:05 +0000 | |
commit | d66061b7f960e24facd77f52c633a3b97fd89418 (patch) | |
tree | 88b5162530d32056d7cd37e59245fb0da179ec21 /libs/binder/UtilsHost.cpp | |
parent | b029cb573e4bef5688757f3dfa129a848dfa372c (diff) | |
parent | b59b0e832374b13f4a7ae9ec0758a20363b1c1c1 (diff) |
Merge "Binder unique_fd" into main am: 1cc6ef1a50 am: b59b0e8323
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/2813342
Change-Id: I9df19ec5dad8d1f58a52ca0082c0c80f9c864250
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Diffstat (limited to 'libs/binder/UtilsHost.cpp')
-rw-r--r-- | libs/binder/UtilsHost.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/libs/binder/UtilsHost.cpp b/libs/binder/UtilsHost.cpp index 3db038f03f..ae1a6c44d7 100644 --- a/libs/binder/UtilsHost.cpp +++ b/libs/binder/UtilsHost.cpp @@ -25,10 +25,13 @@ #include <log/log.h> +#include "FdUtils.h" #include "Utils.h" namespace android { +using android::binder::unique_fd; + CommandResult::~CommandResult() { if (!pid.has_value()) return; if (*pid == 0) { @@ -83,13 +86,13 @@ std::optional<CommandResult> execute(std::vector<std::string> argStringVec, argv.push_back(nullptr); CommandResult ret; - android::base::unique_fd outWrite; - if (!android::base::Pipe(&ret.outPipe, &outWrite)) { + unique_fd outWrite; + if (!binder::Pipe(&ret.outPipe, &outWrite)) { PLOGE("pipe() for outPipe"); return {}; } - android::base::unique_fd errWrite; - if (!android::base::Pipe(&ret.errPipe, &errWrite)) { + unique_fd errWrite; + if (!binder::Pipe(&ret.errPipe, &errWrite)) { PLOGE("pipe() for errPipe"); return {}; } @@ -120,7 +123,7 @@ std::optional<CommandResult> execute(std::vector<std::string> argStringVec, errWrite.reset(); ret.pid = pid; - auto handlePoll = [](android::base::unique_fd* fd, const pollfd* pfd, std::string* s) { + auto handlePoll = [](unique_fd* fd, const pollfd* pfd, std::string* s) { if (!fd->ok()) return true; if (pfd->revents & POLLIN) { char buf[1024]; |