diff options
author | 2023-11-14 11:33:10 -0800 | |
---|---|---|
committer | 2023-11-14 11:36:06 -0800 | |
commit | bfb13a8860abce921e6fe832e9fc06d1ec58d5c4 (patch) | |
tree | 1605c1b55b5f0c2abb524cfa54c39ecc450540f6 /libs/binder/RpcSession.cpp | |
parent | 7ba2e7ea7a44994ba0da16d906510f275233c1ee (diff) |
Use unique_fd::ok() instead of -1 comparison
Test: mma
Bug: 302723053
Change-Id: I744bdfe735624ad9f95a7d448919e7bd2e430098
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)); |