Use 3 params for fcntl()

This commit is contained in:
Sergey Lyubka committed 2022-01-10 18:21:13 +00:00
1 parent de95f28598
commit 456e8bd249
2 files changed
+4 -4

No files matched your search

+2 -2
View File
@@ -3045,8 +3045,8 @@ static void mg_set_non_blocking_mode(SOCKET fd) {
#elif MG_ARCH == MG_ARCH_AZURERTOS
fcntl(fd, F_SETFL, O_NONBLOCK);
#else
fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) | O_NONBLOCK); // Set non-blocking mode
fcntl(fd, F_SETFD, FD_CLOEXEC); // Set close-on-exec
fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) | O_NONBLOCK); // Non-blocking mode
fcntl(fd, F_SETFD, FD_CLOEXEC); // Set close-on-exec
#endif
}
+2 -2
View File
@@ -174,8 +174,8 @@ static void mg_set_non_blocking_mode(SOCKET fd) {
#elif MG_ARCH == MG_ARCH_AZURERTOS
fcntl(fd, F_SETFL, O_NONBLOCK);
#else
fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) | O_NONBLOCK); // Set non-blocking mode
fcntl(fd, F_SETFD, FD_CLOEXEC); // Set close-on-exec
fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) | O_NONBLOCK); // Non-blocking mode
fcntl(fd, F_SETFD, FD_CLOEXEC); // Set close-on-exec
#endif
}