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.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/libs/binder/RpcServer.cpp b/libs/binder/RpcServer.cpp
index 9cc6e7fe04..59659bd0a6 100644
--- a/libs/binder/RpcServer.cpp
+++ b/libs/binder/RpcServer.cpp
@@ -255,7 +255,10 @@ bool RpcServer::setupSocketServer(const RpcSocketAddress& addr) {
LOG_RPC_DETAIL("Successfully setup socket server %s", addr.toString().c_str());
- mServer = std::move(serverFd);
+ if (!setupExternalServer(std::move(serverFd))) {
+ ALOGE("Another thread has set up server while calling setupSocketServer. Race?");
+ return false;
+ }
return true;
}