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

Commit 1e88a722 authored by Jiyong Park's avatar Jiyong Park Committed by Android (Google) Code Review
Browse files

Merge "Don't set MSG_NOSIGNAL when receiving or reading" into main

parents 441b9c6e 79dfeca2
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -125,8 +125,7 @@ ssize_t receiveMessageFromSocket(const RpcTransportFd& socket, iovec* iovs, int
                .msg_control = msgControlBuf,
                .msg_controllen = sizeof(msgControlBuf),
        };
        ssize_t processSize =
                TEMP_FAILURE_RETRY(recvmsg(socket.fd.get(), &msg, MSG_NOSIGNAL | MSG_CMSG_CLOEXEC));
        ssize_t processSize = TEMP_FAILURE_RETRY(recvmsg(socket.fd.get(), &msg, MSG_CMSG_CLOEXEC));
        if (processSize < 0) {
            return -1;
        }
@@ -160,7 +159,7 @@ ssize_t receiveMessageFromSocket(const RpcTransportFd& socket, iovec* iovs, int
            .msg_iovlen = static_cast<decltype(msg.msg_iovlen)>(niovs),
    };

    return TEMP_FAILURE_RETRY(recvmsg(socket.fd.get(), &msg, MSG_NOSIGNAL));
    return TEMP_FAILURE_RETRY(recvmsg(socket.fd.get(), &msg, 0));
}

} // namespace android::binder::os
+1 −1
Original line number Diff line number Diff line
@@ -60,7 +60,7 @@ int socketFree(BIO* bio) {
}
int socketRead(BIO* bio, char* buf, int size) {
    borrowed_fd fd(static_cast<int>(reinterpret_cast<intptr_t>(BIO_get_data(bio))));
    int ret = TEMP_FAILURE_RETRY(::recv(fd.get(), buf, size, MSG_NOSIGNAL));
    int ret = TEMP_FAILURE_RETRY(::recv(fd.get(), buf, size, 0));
    BIO_clear_retry_flags(bio);
    if (errno == EAGAIN || errno == EWOULDBLOCK) {
        BIO_set_retry_read(bio);