net/tcp: return ENOTCONN if the connect migrate to the closed state

Change-Id: I15ee2a7ccbdc792c2c910ee9632714622bc5e0fd
Signed-off-by: chao.an <anchao@xiaomi.com>
This commit is contained in:
chao.an
2021-03-06 13:59:28 +08:00
committed by chao an
parent 8d1ec7b2d0
commit 3d0775e79a
+1 -1
View File
@@ -728,7 +728,7 @@ ssize_t psock_tcp_recvfrom(FAR struct socket *psock, FAR void *buf,
* recvfrom() will get an end-of-file indication.
*/
if (ret <= 0 && !_SS_ISCLOSED(psock->s_flags))
if (ret <= 0 || _SS_ISCLOSED(psock->s_flags))
{
/* Nothing was previously received from the read-ahead buffers.
* The SOCK_STREAM must be (re-)connected in order to receive any