Fixed #49848 (Non-blocking socket emit a sock error while read return EWOULDBLOCK) especially for EWOULDBLOCK (added task #14275 for the general problem)

This commit is contained in:
sg 2016-12-15 22:32:46 +01:00
parent c13a43e5c8
commit d9f461e4e4

View File

@ -482,7 +482,7 @@ lwip_accept(int s, struct sockaddr *addr, socklen_t *addrlen)
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 @@ lwip_recvfrom(int s, void *mem, size_t len, int flags,
return off;
}
LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_recvfrom(%d): returning EWOULDBLOCK\n", s));
sock_set_errno(sock, EWOULDBLOCK);
set_errno(EWOULDBLOCK);
return -1;
}