aboutsummaryrefslogtreecommitdiff
path: root/src/microhttpd
diff options
context:
space:
mode:
authorEvgeny Grin (Karlson2k) <k2k@narod.ru>2016-01-17 16:55:25 +0000
committerEvgeny Grin (Karlson2k) <k2k@narod.ru>2016-01-17 16:55:25 +0000
commit76345508b0a0d4acc78363e869f706172750d120 (patch)
treef44b1a131c4216ca7aa0b87cbd827b3f941392bd /src/microhttpd
parent3a2ecf68e654e3612d32f8d7eb41c5bbadf7a563 (diff)
downloadlibmicrohttpd-76345508b0a0d4acc78363e869f706172750d120.tar.gz
libmicrohttpd-76345508b0a0d4acc78363e869f706172750d120.zip
make_nonblocking_noninheritable(): fixed checking for current non-blocking flags,
improved error report.
Diffstat (limited to 'src/microhttpd')
-rw-r--r--src/microhttpd/daemon.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index 7f0a1cdf..ef002eea 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -1878,12 +1878,13 @@ make_nonblocking_noninheritable (struct MHD_Daemon *daemon,
1878#endif 1878#endif
1879 flags = fcntl (sock, F_GETFD); 1879 flags = fcntl (sock, F_GETFD);
1880 if ( ( (-1 == flags) || 1880 if ( ( (-1 == flags) ||
1881 ( (flags != (flags | FD_CLOEXEC)) && 1881 ( (flags != (flags | nonblock | FD_CLOEXEC)) &&
1882 (0 != fcntl (sock, F_SETFD, flags | nonblock | FD_CLOEXEC)) ) ) ) 1882 (0 != fcntl (sock, F_SETFD, flags | nonblock | FD_CLOEXEC)) ) ) )
1883 { 1883 {
1884#ifdef HAVE_MESSAGES 1884#ifdef HAVE_MESSAGES
1885 MHD_DLOG (daemon, 1885 MHD_DLOG (daemon,
1886 "Failed to make socket non-inheritable: %s\n", 1886 "Failed to make socket %snon-inheritable: %s\n",
1887 ((nonblock) ? "non-blocking " : ""),
1887 MHD_socket_last_strerr_ ()); 1888 MHD_socket_last_strerr_ ());
1888#endif 1889#endif
1889 } 1890 }