This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new e2cf0cad39 rpmsg_sockif: recv/recvmsg return 0 when peer close
e2cf0cad39 is described below
commit e2cf0cad391ae8d8d798cc440e7a1414b0a45a44
Author: Bowen Wang <[email protected]>
AuthorDate: Tue Oct 24 16:33:17 2023 +0800
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 <[email protected]>
---
net/rpmsg/rpmsg_sockif.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/rpmsg/rpmsg_sockif.c b/net/rpmsg/rpmsg_sockif.c
index 4ff9838204..9931c9903f 100644
--- a/net/rpmsg/rpmsg_sockif.c
+++ b/net/rpmsg/rpmsg_sockif.c
@@ -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);