From d9f461e4e4495ec7aaf1035f6d82448dd8f19a5d Mon Sep 17 00:00:00 2001 From: sg Date: Thu, 15 Dec 2016 22:32:46 +0100 Subject: [PATCH] Fixed #49848 (Non-blocking socket emit a sock error while read return EWOULDBLOCK) especially for EWOULDBLOCK (added task #14275 for the general problem) --- src/api/sockets.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api/sockets.c b/src/api/sockets.c index ae2c7553..d49e6416 100644 --- a/src/api/sockets.c +++ b/src/api/sockets.c @@ -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; }