summaryrefslogtreecommitdiff
path: root/libs/binder/RpcServer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/binder/RpcServer.cpp')
-rw-r--r--libs/binder/RpcServer.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/libs/binder/RpcServer.cpp b/libs/binder/RpcServer.cpp
index 540c346b87..e3bf2a5e36 100644
--- a/libs/binder/RpcServer.cpp
+++ b/libs/binder/RpcServer.cpp
@@ -151,9 +151,11 @@ void RpcServer::join() {
LOG_ALWAYS_FATAL_IF(mShutdownTrigger == nullptr, "Cannot create join signaler");
}
- while (mShutdownTrigger->triggerablePollRead(mServer)) {
+ status_t status;
+ while ((status = mShutdownTrigger->triggerablePollRead(mServer)) == OK) {
(void)acceptOne();
}
+ LOG_RPC_DETAIL("RpcServer::join exiting with %s", statusToString(status).c_str());
{
std::lock_guard<std::mutex> _l(mLock);
@@ -236,9 +238,13 @@ void RpcServer::establishConnection(sp<RpcServer>&& server, base::unique_fd clie
LOG_ALWAYS_FATAL_IF(server->mShutdownTrigger == nullptr);
int32_t id;
- bool idValid = server->mShutdownTrigger->interruptableRecv(clientFd.get(), &id, sizeof(id));
+ status_t status =
+ server->mShutdownTrigger->interruptableReadFully(clientFd.get(), &id, sizeof(id));
+ bool idValid = status == OK;
if (!idValid) {
- ALOGE("Failed to read ID for client connecting to RPC server.");
+ ALOGE("Failed to read ID for client connecting to RPC server: %s",
+ statusToString(status).c_str());
+ // still need to cleanup before we can return
}
std::thread thisThread;