Parcourir la source

fix lwip-2.1.2 O_NONBLOCK

Weilin Wang il y a 4 ans
Parent
commit
6f9c488528
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      components/net/lwip-2.1.2/src/api/sockets.c

+ 1 - 1
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;