libbinder: RPC use 'status_t' over 'bool'
For ease of debugging/handling errors (I realized that binderRpcTest
currently crashes on Pixel 3 because of some missing kernel patches -
this would have been easier with this, and one potential (even if
temporary) solution would be to check the return code).
Bug: 167966510
Test: binderRpcTest, binderRpcBenchmark, binder_parcel_fuzzer,
binder_rpc_fuzzer, binderHostDeviceTest
Change-Id: I1baa2e9380e0ec8f82f8ceb250f3eeb632dc5fbc
diff --git a/libs/binder/ServiceManagerHost.cpp b/libs/binder/ServiceManagerHost.cpp
index 1c2f9b4..59334b7 100644
--- a/libs/binder/ServiceManagerHost.cpp
+++ b/libs/binder/ServiceManagerHost.cpp
@@ -158,8 +158,10 @@
LOG_ALWAYS_FATAL_IF(!forwardResult->hostPort().has_value());
auto rpcSession = RpcSession::make();
- if (!rpcSession->setupInetClient("127.0.0.1", *forwardResult->hostPort())) {
- ALOGE("Unable to set up inet client on host port %u", *forwardResult->hostPort());
+ if (status_t status = rpcSession->setupInetClient("127.0.0.1", *forwardResult->hostPort());
+ status != OK) {
+ ALOGE("Unable to set up inet client on host port %u: %s", *forwardResult->hostPort(),
+ statusToString(status).c_str());
return nullptr;
}
auto binder = rpcSession->getRootObject();