Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a4c94756 authored by Steven Moreland's avatar Steven Moreland
Browse files

libbinder: modernize unique_fd&& -> unique_fd

The future can't wait!

Bug: N/A
Test: binderRpcTest
Change-Id: I74b041853b528f38e5bc55e8738ec399622cbf1a
parent 82261324
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -406,14 +406,14 @@ bool RpcConnection::setupOneSocketClient(const SocketAddress& addr) {
    return true;
}

void RpcConnection::addClient(unique_fd&& fd) {
void RpcConnection::addClient(unique_fd fd) {
    std::lock_guard<std::mutex> _l(mSocketMutex);
    sp<ConnectionSocket> connection = sp<ConnectionSocket>::make();
    connection->fd = std::move(fd);
    mClients.push_back(connection);
}

sp<RpcConnection::ConnectionSocket> RpcConnection::assignServerToThisThread(unique_fd&& fd) {
sp<RpcConnection::ConnectionSocket> RpcConnection::assignServerToThisThread(unique_fd fd) {
    std::lock_guard<std::mutex> _l(mSocketMutex);
    sp<ConnectionSocket> connection = sp<ConnectionSocket>::make();
    connection->fd = std::move(fd);
+2 −2
Original line number Diff line number Diff line
@@ -148,8 +148,8 @@ private:
    bool setupSocketServer(const SocketAddress& address);
    bool setupSocketClient(const SocketAddress& address);
    bool setupOneSocketClient(const SocketAddress& address);
    void addClient(base::unique_fd&& fd);
    sp<ConnectionSocket> assignServerToThisThread(base::unique_fd&& fd);
    void addClient(base::unique_fd fd);
    sp<ConnectionSocket> assignServerToThisThread(base::unique_fd fd);
    bool removeServerSocket(const sp<ConnectionSocket>& socket);

    enum class SocketUse {