diff options
author | 2022-11-17 09:41:04 +0000 | |
---|---|---|
committer | 2022-11-17 09:41:04 +0000 | |
commit | e7cee8931e4e9ccd76f11191de54fa74cd91a1f7 (patch) | |
tree | 55b9f610eafb391757b623538f6d1f6d2d0fc5f0 | |
parent | 658e4e3c8514db338436616c13c583abcf366370 (diff) | |
parent | 5bd715c27365d943bfa24635cbbdcbc8a498195c (diff) |
Merge "[rpc_binder] Use unique_fd directly for socket in raw socket setup" am: 8353dd2639 am: 5144d4162e am: 5bd715c273
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/2303772
Change-Id: Idc1087141867f11a9c41489ad398f841df0707de
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r-- | libs/binder/RpcServer.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/libs/binder/RpcServer.cpp b/libs/binder/RpcServer.cpp index e0b7d16d9f..0820cd1d5c 100644 --- a/libs/binder/RpcServer.cpp +++ b/libs/binder/RpcServer.cpp @@ -549,18 +549,17 @@ status_t RpcServer::setupSocketServer(const RpcSocketAddress& addr) { status_t RpcServer::setupRawSocketServer(unique_fd socket_fd) { LOG_ALWAYS_FATAL_IF(!socket_fd.ok(), "Socket must be setup to listen."); - RpcTransportFd transportFd(std::move(socket_fd)); // Right now, we create all threads at once, making accept4 slow. To avoid hanging the client, // the backlog is increased to a large number. // TODO(b/189955605): Once we create threads dynamically & lazily, the backlog can be reduced // to 1. - if (0 != TEMP_FAILURE_RETRY(listen(transportFd.fd.get(), 50 /*backlog*/))) { + if (0 != TEMP_FAILURE_RETRY(listen(socket_fd.get(), 50 /*backlog*/))) { int savedErrno = errno; ALOGE("Could not listen initialized Unix socket: %s", strerror(savedErrno)); return -savedErrno; } - if (status_t status = setupExternalServer(std::move(transportFd.fd)); status != OK) { + if (status_t status = setupExternalServer(std::move(socket_fd)); status != OK) { ALOGE("Another thread has set up server while calling setupSocketServer. Race?"); return status; } |