Fix FD_CLOEXEC setting

This commit is contained in:
Sergey Lyubka committed 2021-07-13 22:49:36 +01:00
1 parent 2bfd30ab4b
commit 39d64be581
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -126,7 +126,7 @@ static void mg_set_non_blocking_mode(SOCKET fd) {
setsockopt(fd, 0, FREERTOS_SO_RCVTIMEO, &off, sizeof(off));
setsockopt(fd, 0, FREERTOS_SO_SNDTIMEO, &off, sizeof(off));
#else
fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) | O_NONBLOCK | FD_CLOEXEC);
fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) | O_NONBLOCK, FD_CLOEXEC);
#endif
}