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/RpcServer.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/RpcServer.cpp')
-rw-r--r-- | libs/binder/RpcServer.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libs/binder/RpcServer.cpp b/libs/binder/RpcServer.cpp index 1ba20b3103..fefaa810d2 100644 --- a/libs/binder/RpcServer.cpp +++ b/libs/binder/RpcServer.cpp @@ -168,7 +168,7 @@ void RpcServer::setConnectionFilter(std::function<bool(const void*, size_t)>&& f void RpcServer::setServerSocketModifier(std::function<void(base::borrowed_fd)>&& modifier) { RpcMutexLockGuard _l(mLock); - LOG_ALWAYS_FATAL_IF(mServer.fd != -1, "Already started"); + LOG_ALWAYS_FATAL_IF(mServer.fd.ok(), "Already started"); mServerSocketModifier = std::move(modifier); } @@ -200,7 +200,7 @@ void RpcServer::start() { status_t RpcServer::acceptSocketConnection(const RpcServer& server, RpcTransportFd* out) { RpcTransportFd clientSocket(unique_fd(TEMP_FAILURE_RETRY( accept4(server.mServer.fd.get(), nullptr, nullptr, SOCK_CLOEXEC | SOCK_NONBLOCK)))); - if (clientSocket.fd < 0) { + if (!clientSocket.fd.ok()) { int savedErrno = errno; ALOGE("Could not accept4 socket: %s", strerror(savedErrno)); return -savedErrno; |