diff --git a/net/rpmsg/rpmsg_sockif.c b/net/rpmsg/rpmsg_sockif.c index 5f662d07ca..7fcc0ecf8e 100644 --- a/net/rpmsg/rpmsg_sockif.c +++ b/net/rpmsg/rpmsg_sockif.c @@ -918,14 +918,16 @@ static int rpmsg_socket_poll(FAR struct socket *psock, nxmutex_unlock(&conn->recvlock); } - else if (!_SS_ISCONNECTED(conn->sconn.s_flags) && - _SS_ISNONBLOCK(conn->sconn.s_flags)) + else /* !_SS_ISCONNECTED(conn->sconn.s_flags) */ { - ret = OK; - } - else - { - eventset |= POLLERR; + if (!conn->ept.rdev || conn->unbind) + { + eventset |= POLLHUP; + } + else + { + ret = OK; + } } rpmsg_socket_poll_notify(conn, eventset);