[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] branch master updated: clean up #define mess a bit
From: |
gnunet |
Subject: |
[libmicrohttpd] branch master updated: clean up #define mess a bit |
Date: |
Fri, 14 Feb 2020 15:44:12 +0100 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository libmicrohttpd.
The following commit(s) were added to refs/heads/master by this push:
new eda21a5c clean up #define mess a bit
eda21a5c is described below
commit eda21a5c2a9a3d08fdfdaef3d6a66fe6ad4ed265
Author: Christian Grothoff <address@hidden>
AuthorDate: Fri Feb 14 15:40:18 2020 +0100
clean up #define mess a bit
---
src/microhttpd/mhd_sockets.c | 16 ++++------------
src/microhttpd/mhd_sockets.h | 10 ++++++++--
2 files changed, 12 insertions(+), 14 deletions(-)
diff --git a/src/microhttpd/mhd_sockets.c b/src/microhttpd/mhd_sockets.c
index cda00fdd..1448341a 100644
--- a/src/microhttpd/mhd_sockets.c
+++ b/src/microhttpd/mhd_sockets.c
@@ -17,18 +17,12 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
*/
-
/**
* @file microhttpd/mhd_sockets.c
* @brief Implementation for sockets functions
* @author Karlson2k (Evgeny Grin)
*/
-
#include "mhd_sockets.h"
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif /* HAVE_UNISTD_H */
-#include <fcntl.h>
#ifdef MHD_WINSOCK_SOCKETS
@@ -613,12 +607,10 @@ MHD_socket_create_listen_ (int pf)
if (MHD_INVALID_SOCKET == fd)
return MHD_INVALID_SOCKET;
-#if defined(SOCK_NOSIGPIPE) || defined(MHD_socket_nosignal_)
+#if defined(MHD_socket_nosignal_)
if ( ( (! nosigpipe_set)
-#ifdef MHD_socket_nosignal_
- || (! MHD_socket_nosignal_ (fd))
-#endif /* MHD_socket_nosignal_ */
- ) && (0 == MAYBE_MSG_NOSIGNAL) )
+ || (! MHD_socket_nosignal_ (fd)) ) &&
+ (0 == MAYBE_MSG_NOSIGNAL) )
{
/* SIGPIPE disable is possible on this platform
* (so application expect that it will be disabled),
@@ -629,7 +621,7 @@ MHD_socket_create_listen_ (int pf)
MHD_socket_fset_error_ (err);
return MHD_INVALID_SOCKET;
}
-#endif /* SOCK_NOSIGPIPE || MHD_socket_nosignal_ */
+#endif /* defined(MHD_socket_nosignal_) */
if (! cloexec_set)
(void) MHD_socket_noninheritable_ (fd);
diff --git a/src/microhttpd/mhd_sockets.h b/src/microhttpd/mhd_sockets.h
index aaf58e4a..0241ef28 100644
--- a/src/microhttpd/mhd_sockets.h
+++ b/src/microhttpd/mhd_sockets.h
@@ -36,6 +36,10 @@
#include <errno.h>
#include <stdbool.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif /* HAVE_UNISTD_H */
+#include <fcntl.h>
#if ! defined(MHD_POSIX_SOCKETS) && ! defined(MHD_WINSOCK_SOCKETS)
# if ! defined(_WIN32) || defined(__CYGWIN__)
@@ -854,10 +858,12 @@ static const int _MHD_socket_int_one = 1;
* @param sock socket to manipulate
* @return non-zero if succeeded, zero otherwise
*/
-# define MHD_socket_nosignal_(sock) \
+#define MHD_socket_nosignal_(sock) \
(! setsockopt ((sock),SOL_SOCKET,SO_NOSIGPIPE,&_MHD_socket_int_one, \
sizeof(_MHD_socket_int_one)))
-#endif /* SOL_SOCKET && SO_NOSIGPIPE */
+#elif defined(MHD_POSIX_SOCKETS) && defined(SOCK_NOSIGPIPE) && \
+ defined(SOCK_CLOEXEC)
+#endif
/**
* Create a listen socket, with noninheritable flag if possible.
--
To stop receiving notification emails like this one, please contact
address@hidden.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [libmicrohttpd] branch master updated: clean up #define mess a bit,
gnunet <=