Fixed #49848 (Non-blocking socket emit a sock error while read return EWOULDBLOCK) especially for EWOULDBLOCK (added task #14275 for the general problem)
diff --git a/src/api/sockets.c b/src/api/sockets.c
index ae2c755..d49e641 100644
--- a/src/api/sockets.c
+++ b/src/api/sockets.c
@@ -482,7 +482,7 @@
if (netconn_is_nonblocking(sock->conn) && (sock->rcvevent <= 0)) {
LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_accept(%d): returning EWOULDBLOCK\n", s));
- sock_set_errno(sock, EWOULDBLOCK);
+ set_errno(EWOULDBLOCK);
return -1;
}
@@ -771,7 +771,7 @@
return off;
}
LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_recvfrom(%d): returning EWOULDBLOCK\n", s));
- sock_set_errno(sock, EWOULDBLOCK);
+ set_errno(EWOULDBLOCK);
return -1;
}