From 6f9c4885287ea3096c3515e3e83f619d8f641f89 Mon Sep 17 00:00:00 2001 From: Weilin Wang Date: Thu, 12 Aug 2021 20:17:16 +0800 Subject: [PATCH] fix lwip-2.1.2 O_NONBLOCK --- components/net/lwip-2.1.2/src/api/sockets.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/net/lwip-2.1.2/src/api/sockets.c b/components/net/lwip-2.1.2/src/api/sockets.c index 4fea5b3727..85e5ad1bc9 100644 --- a/components/net/lwip-2.1.2/src/api/sockets.c +++ b/components/net/lwip-2.1.2/src/api/sockets.c @@ -3905,7 +3905,7 @@ lwip_fcntl(int s, int cmd, int val) case F_SETFL: /* Bits corresponding to the file access mode and the file creation flags [..] that are set in arg shall be ignored */ val &= ~(O_RDONLY | O_WRONLY | O_RDWR); - if ((val & ~O_NONBLOCK) == 0) { + if ((val & O_NONBLOCK) == O_NONBLOCK) { /* only O_NONBLOCK, all other bits are zero */ netconn_set_nonblocking(sock->conn, val & O_NONBLOCK); ret = 0; -- Gitee