From 456e8bd249728c7dffc6b422afa8f546c0e25986 Mon Sep 17 00:00:00 2001 From: Sergey Lyubka Date: Mon, 10 Jan 2022 18:21:13 +0000 Subject: [PATCH] Use 3 params for fcntl() --- mongoose.c | 4 ++-- src/sock.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mongoose.c b/mongoose.c index 80a7df48..1c236204 100644 --- a/mongoose.c +++ b/mongoose.c @@ -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 } diff --git a/src/sock.c b/src/sock.c index d103b024..d13a22c9 100644 --- a/src/sock.c +++ b/src/sock.c @@ -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 }