Procházet zdrojové kódy

Renamed 'MHD_pipe_' -> 'MHD_itc_init_'

Evgeny Grin (Karlson2k) před 9 roky
rodič
revize
5688db4e34
2 změnil soubory, kde provedl 14 přidání a 8 odebrání
  1. 2 2
      src/microhttpd/daemon.c
  2. 12 6
      src/microhttpd/mhd_itc.h

+ 2 - 2
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,

+ 12 - 6
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