commit 5688db4e34f1e0742a3c3cd714ea6f0e10799923
parent 21ffb5e8420d6b4284932ae0eb6021f2118e21be
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date: Tue, 11 Oct 2016 15:20:56 +0000
Renamed 'MHD_pipe_' -> 'MHD_itc_init_'
Diffstat:
2 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
@@ -4462,7 +4462,7 @@ MHD_start_daemon_va (unsigned int flags,
use_pipe = 0; /* useless if we are using 'external' select */
if (use_pipe)
{
- if (! MHD_pipe_ (daemon->wpipe))
+ if (! MHD_itc_init_ (daemon->wpipe))
{
#ifdef HAVE_MESSAGES
MHD_DLOG (daemon,
@@ -4984,7 +4984,7 @@ MHD_start_daemon_va (unsigned int flags,
/* Always use individual control pipes */
if (1)
{
- if (! MHD_pipe_ (d->wpipe))
+ if (! MHD_itc_init_ (d->wpipe))
{
#ifdef HAVE_MESSAGES
MHD_DLOG (daemon,
diff --git a/src/microhttpd/mhd_itc.h b/src/microhttpd/mhd_itc.h
@@ -55,9 +55,11 @@
typedef int MHD_itc_;
/**
- * create pipe
+ * Initialise ITC by generating eventFD
+ * @param itc the itc to initialise
+ * @return non-zero if succeeded, zero otherwise
*/
-#define MHD_pipe_(itc) ((-1 == (itc = eventfd (0, EFD_CLOEXEC | EFD_NONBLOCK))) ? 0 : !0)
+#define MHD_itc_init_(itc) ((-1 == ((itc) = eventfd (0, EFD_CLOEXEC | EFD_NONBLOCK))) ? 0 : !0)
/***
* Get description string of last errno for pipe operations.
@@ -134,9 +136,11 @@ struct MHD_Itc
typedef struct MHD_Itc MHD_itc_;
/**
- * create pipe
+ * Initialise ITC by generating pipe
+ * @param itc the itc to initialise
+ * @return non-zero if succeeded, zero otherwise
*/
-#define MHD_pipe_(pip) (!pipe((pip).fd))
+#define MHD_itc_init_(itc) (!pipe((itc).fd))
/***
* Get description string of last errno for pipe operations.
@@ -211,9 +215,11 @@ struct MHD_Itc
typedef struct MHD_Itc MHD_itc_;
/**
- * Create two connected sockets to emulate a pipe.
+ * Initialise ITC by generating socketpair
+ * @param itc the itc to initialise
+ * @return non-zero if succeeded, zero otherwise
*/
-#define MHD_pipe_(pip) MHD_socket_pair_((pip.fd))
+#define MHD_itc_init_(itc) MHD_socket_pair_((itc).fd)
/**
* Get description string of last pipe error