diff options
author | 2023-11-15 05:45:39 +0000 | |
---|---|---|
committer | 2023-11-15 05:45:39 +0000 | |
commit | c186fdb03323725c25021d617eadec97f47aabc5 (patch) | |
tree | f92cf5a1784e8a3145ac86a8003e60ac3cbff3b2 /libs/binder/RpcSession.cpp | |
parent | e65f8ddd8b3b5be7f25d09d13a3a796a33c513e2 (diff) | |
parent | 1c85b787c76eb846199d8dc8b1b8ba483429af4c (diff) |
Merge "Use unique_fd::ok() instead of -1 comparison" into main am: 1c85b787c7
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/2830392
Change-Id: I3b58ab5cdca3848edcb05d29e11fc81c2359e4d4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Diffstat (limited to 'libs/binder/RpcSession.cpp')
-rw-r--r-- | libs/binder/RpcSession.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libs/binder/RpcSession.cpp b/libs/binder/RpcSession.cpp index c895b21f91..cd8f41711f 100644 --- a/libs/binder/RpcSession.cpp +++ b/libs/binder/RpcSession.cpp @@ -208,7 +208,7 @@ status_t RpcSession::addNullDebuggingClient() { unique_fd serverFd(TEMP_FAILURE_RETRY(open("/dev/null", O_WRONLY | O_CLOEXEC))); - if (serverFd == -1) { + if (!serverFd.ok()) { int savedErrno = errno; ALOGE("Could not connect to /dev/null: %s", strerror(savedErrno)); return -savedErrno; @@ -594,7 +594,7 @@ status_t RpcSession::setupOneSocketConnection(const RpcSocketAddress& addr, unique_fd serverFd(TEMP_FAILURE_RETRY( socket(addr.addr()->sa_family, SOCK_STREAM | SOCK_CLOEXEC | SOCK_NONBLOCK, 0))); - if (serverFd == -1) { + if (!serverFd.ok()) { int savedErrno = errno; ALOGE("Could not create socket at %s: %s", addr.toString().c_str(), strerror(savedErrno)); |