diff options
| author | 2023-11-15 06:17:39 +0000 | |
|---|---|---|
| committer | 2023-11-15 06:17:39 +0000 | |
| commit | a7dd940087d98928e42e14a46f31c6998224a57c (patch) | |
| tree | 9c7353d2888f8d7f2f874cd282e3617fc59ac1a9 /libs/binder/RpcSession.cpp | |
| parent | 93f41a7ee95fe9a36cf7861869e766894e1f247f (diff) | |
| parent | c186fdb03323725c25021d617eadec97f47aabc5 (diff) | |
Merge "Use unique_fd::ok() instead of -1 comparison" into main am: 1c85b787c7 am: c186fdb033
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/2830392
Change-Id: I7b4fc3861e02138bc20f9534e7a3bf18eee1cbed
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)); |