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

Commit 0618148f authored by Jeff Brown's avatar Jeff Brown
Browse files

input: Handle a few extra error conditions.

It turns out that SOCK_SEQPACKET sockets may sometimes return
ECONNREFUSED or ECONNRESET errors when the peer dies instead of
the usual EPIPE.

Bug: 9479906
Change-Id: Ia7e572b08bf63e43ba5aeda58281508beb5f8c73
parent 736d4ddc
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -159,7 +159,7 @@ status_t InputChannel::sendMessage(const InputMessage* msg) {
        if (error == EAGAIN || error == EWOULDBLOCK) {
            return WOULD_BLOCK;
        }
        if (error == EPIPE || error == ENOTCONN) {
        if (error == EPIPE || error == ENOTCONN || error == ECONNREFUSED || error == ECONNRESET) {
            return DEAD_OBJECT;
        }
        return -error;
@@ -193,7 +193,7 @@ status_t InputChannel::receiveMessage(InputMessage* msg) {
        if (error == EAGAIN || error == EWOULDBLOCK) {
            return WOULD_BLOCK;
        }
        if (error == EPIPE || error == ENOTCONN) {
        if (error == EPIPE || error == ENOTCONN || error == ECONNREFUSED) {
            return DEAD_OBJECT;
        }
        return -error;