commit 519d121f91034c6c2c9c4f7ed3e728884a23ecf6
parent 3de91d17fd2edbe0d131bdee60876b05dd3ffb71
Author: Christian Grothoff <christian@grothoff.org>
Date: Wed, 12 Feb 2014 16:38:18 +0000
From: Karlson2k <k2k@narod.ru>
Date: Wed, 12 Feb 2014 17:34:05 +0400
Subject: [PATCH] MHD_accept_connection small refactoring: choose at compile
time instead of run time
Diffstat:
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
@@ -609,7 +609,7 @@ MHD_get_fdset (struct MHD_Daemon *daemon,
if (daemon->epoll_fd >= FD_SETSIZE)
return MHD_NO; /* poll fd too big, fail hard */
FD_SET (daemon->epoll_fd, read_fd_set);
- if ( (NULL != max_fd) && (*max_fd) < daemon->epoll_fd) )
+ if ( (NULL != max_fd) && ((*max_fd) < daemon->epoll_fd) )
*max_fd = daemon->epoll_fd;
return MHD_YES;
}
@@ -1736,8 +1736,9 @@ MHD_accept_connection (struct MHD_Daemon *daemon)
}
return MHD_NO;
}
- if ( (! HAVE_ACCEPT4) || (0 == SOCK_CLOEXEC) )
- make_nonblocking_noninheritable (daemon, s);
+#if !defined(HAVE_ACCEPT4) || SOCK_CLOEXEC+0 == 0
+ make_nonblocking_noninheritable (daemon, s);
+#endif
#if HAVE_MESSAGES
#if DEBUG_CONNECT
MHD_DLOG (daemon, "Accepted connection on socket %d\n", s);