rpmsg_sockif: recv/recvmsg return 0 when peer close

Follow the posix standard:
If no messages are available to be received and the peer has
performed an orderly shutdown, recv() shall return 0.

Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
This commit is contained in:
Bowen Wang 2023-10-24 16:33:17 +08:00 committed by Xiang Xiao
parent 7a9aa9539c
commit e2cf0cad39
1 changed files with 1 additions and 1 deletions

View File

@ -1301,7 +1301,7 @@ static ssize_t rpmsg_socket_recvmsg(FAR struct socket *psock,
_SO_TIMEOUT(conn->sconn.s_rcvtimeo));
if (!conn->ept.rdev || conn->unbind)
{
ret = -ECONNRESET;
ret = 0;
}
nxmutex_lock(&conn->recvlock);