diff options
author | 2021-05-24 17:52:25 +0000 | |
---|---|---|
committer | 2021-05-24 17:52:25 +0000 | |
commit | 3caff151fed6d44f83aa616e95b26fb3e9f70005 (patch) | |
tree | d48a4a3bd3fc118bbbfe9cc92faa0eab76b965e8 /libs/binder/RpcServer.cpp | |
parent | a0b682cc2d0dc7764279af70465ab3c49e2081c6 (diff) | |
parent | 2b4f380c6548b8c146962eab8bc070e6c3647dc4 (diff) |
Merge changes I097784a4,I6a5dcbb1,Ic52adef0,I5cc00deb
* changes:
libbinder: FdTrigger methods use status_t
libbinder: harder failure on poll failure
libbinder:interruptableRecv>interruptableReadFully
libbinder: FdTrigger detect read POLLHUP/EOF
Diffstat (limited to 'libs/binder/RpcServer.cpp')
-rw-r--r-- | libs/binder/RpcServer.cpp | 12 |
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; |