apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject cvs commit: apr/include/arch/win32 networkio.h
Date Mon, 16 Jul 2001 20:37:01 GMT
wrowe       01/07/16 13:37:01

  Modified:    include  apr_inherit.h
               network_io/unix sockets.c
               include/arch/unix networkio.h
               include/arch/os2 networkio.h
               include/arch/win32 networkio.h
  Log:
    In order to use this IMPLEMENT_SET/UNSET schema, this has got to be a
    bit flag... the apr_file_t already has too many int flags hiding in it,
    and ->flags is already a member of the apr_file_t.
  
  Revision  Changes    Path
  1.4       +8 -8      apr/include/apr_inherit.h
  
  Index: apr_inherit.h
  ===================================================================
  RCS file: /home/cvs/apr/include/apr_inherit.h,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- apr_inherit.h	2001/07/16 20:14:56	1.3
  +++ apr_inherit.h	2001/07/16 20:36:57	1.4
  @@ -65,12 +65,12 @@
   #define APR_DECLARE_SET_INHERIT(name) \
       void apr_##name##_set_inherit(apr_##name##_t *name)
   
  -#define APR_IMPLEMENT_SET_INHERIT(name, pool, cleanup)              \
  +#define APR_IMPLEMENT_SET_INHERIT(name, flag, pool, cleanup)        \
   void apr_##name##_set_inherit(apr_##name##_t *name)                 \
   {                                                                   \
  -    if (!name->inherit) {                                           \
  -        name->inherit = 1;                                          \
  -        apr_pool_cleanup_register(name->pool, (void *)name,   \
  +    if (!(name->flag & APR_INHERIT)) {                              \
  +        name->flag |= APR_INHERIT;                                  \
  +        apr_pool_cleanup_register(name->pool, (void *)name,         \
                                     NULL, cleanup);                   \
       }                                                               \
   }
  @@ -78,12 +78,12 @@
   #define APR_DECLARE_UNSET_INHERIT(name) \
       void apr_##name##_unset_inherit(apr_##name##_t *name)
   
  -#define APR_IMPLEMENT_UNSET_INHERIT(name, pool, cleanup)            \
  +#define APR_IMPLEMENT_UNSET_INHERIT(name, flag, pool, cleanup)      \
   void apr_##name##_unset_inherit(apr_##name##_t *name)               \
   {                                                                   \
  -    if (name->inherit) {                                            \
  -        name->inherit = 0;                                          \
  -        apr_pool_cleanup_kill(name->pool, (void *)name,       \
  +    if (name->flag & APR_INHERIT) {                                 \
  +        name->flag &= ~APR_INHERIT;                                 \
  +        apr_pool_cleanup_kill(name->pool, (void *)name,             \
                                 NULL, cleanup);                       \
       }                                                               \
   }
  
  
  
  1.80      +12 -12    apr/network_io/unix/sockets.c
  
  Index: sockets.c
  ===================================================================
  RCS file: /home/cvs/apr/network_io/unix/sockets.c,v
  retrieving revision 1.79
  retrieving revision 1.80
  diff -u -r1.79 -r1.80
  --- sockets.c	2001/07/16 20:24:21	1.79
  +++ sockets.c	2001/07/16 20:36:59	1.80
  @@ -127,7 +127,7 @@
   }
   
   apr_status_t apr_socket_create(apr_socket_t **new, int ofamily, int type,
  -                               int inherit, apr_pool_t *cont)
  +                               apr_int32_t inherit, apr_pool_t *cont)
   {
       int family = ofamily;
   
  @@ -160,10 +160,10 @@
       set_socket_vars(*new, family, type);
   
       (*new)->timeout = -1;
  -    (*new)->inherit = (inherit & APR_INHERIT) ? 1 : 0;
  +    (*new)->inherit = inherit;
       apr_pool_cleanup_register((*new)->cntxt, (void *)(*new), socket_cleanup,
  -                              (*new)->inherit ? apr_pool_cleanup_null
  -                                              : socket_cleanup);
  +                              (*new)->inherit & APR_INHERIT) 
  +                                  ? apr_pool_cleanup_null : socket_cleanup);
       return APR_SUCCESS;
   } 
   
  @@ -256,8 +256,8 @@
   
       (*new)->inherit = sock->inherit;
       apr_pool_cleanup_register((*new)->cntxt, (void *)(*new), socket_cleanup,
  -                              ((*new)->inherit & APR_INHERIT) ? apr_pool_cleanup_null
  -                                                      : socket_cleanup);
  +                              ((*new)->inherit & APR_INHERIT) 
  +                                  ? apr_pool_cleanup_null : socket_cleanup);
       return APR_SUCCESS;
   }
   
  @@ -334,7 +334,7 @@
   
   apr_status_t apr_os_sock_make(apr_socket_t **apr_sock, 
                                 apr_os_sock_info_t *os_sock_info, 
  -                              int inherit,
  +                              apr_int32_t inherit,
                                 apr_pool_t *cont)
   {
       alloc_socket(apr_sock, cont);
  @@ -358,11 +358,11 @@
                  (*apr_sock)->remote_addr->salen);
       }
           
  -    (*apr_sock)->inherit = (inherit & APR_INHERIT) ? 1 : 0;
  +    (*apr_sock)->inherit = inherit;
       apr_pool_cleanup_register((*apr_sock)->cntxt, (void *)(*apr_sock), 
                                 socket_cleanup,
  -                              (*apr_sock)->inherit ? apr_pool_cleanup_null
  -                                                   : socket_cleanup);
  +                              ((*apr_sock)->inherit & APR_INHERIT)
  +                                  ? apr_pool_cleanup_null : socket_cleanup);
       return APR_SUCCESS;
   }
   
  @@ -382,6 +382,6 @@
       return APR_SUCCESS;
   }
   
  -APR_IMPLEMENT_SET_INHERIT(socket, cntxt, socket_cleanup)
  +APR_IMPLEMENT_SET_INHERIT(socket, inherit, cntxt, socket_cleanup)
   
  -APR_IMPLEMENT_UNSET_INHERIT(socket, cntxt, socket_cleanup)
  +APR_IMPLEMENT_UNSET_INHERIT(socket, inherit, cntxt, socket_cleanup)
  
  
  
  1.48      +1 -1      apr/include/arch/unix/networkio.h
  
  Index: networkio.h
  ===================================================================
  RCS file: /home/cvs/apr/include/arch/unix/networkio.h,v
  retrieving revision 1.47
  retrieving revision 1.48
  diff -u -r1.47 -r1.48
  --- networkio.h	2001/07/16 16:11:04	1.47
  +++ networkio.h	2001/07/16 20:36:59	1.48
  @@ -135,7 +135,7 @@
       int local_port_unknown;
       int local_interface_unknown;
       apr_int32_t netmask;
  -    int inherit;
  +    apr_int32_t inherit;
   };
   
   struct apr_pollfd_t {
  
  
  
  1.21      +1 -1      apr/include/arch/os2/networkio.h
  
  Index: networkio.h
  ===================================================================
  RCS file: /home/cvs/apr/include/arch/os2/networkio.h,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- networkio.h	2001/07/16 18:52:17	1.20
  +++ networkio.h	2001/07/16 20:37:00	1.21
  @@ -73,7 +73,7 @@
       int local_port_unknown;
       int local_interface_unknown;
       apr_int32_t netmask;
  -    int inherit;
  +    apr_int32_t inherit;
   };
   
   struct apr_pollfd_t {
  
  
  
  1.20      +1 -1      apr/include/arch/win32/networkio.h
  
  Index: networkio.h
  ===================================================================
  RCS file: /home/cvs/apr/include/arch/win32/networkio.h,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- networkio.h	2001/07/16 18:51:30	1.19
  +++ networkio.h	2001/07/16 20:37:00	1.20
  @@ -69,7 +69,7 @@
       int local_port_unknown;
       int local_interface_unknown;
       apr_int32_t netmask;
  -    int inherit;
  +    apr_int32_t inherit;
   };
   
   struct apr_pollfd_t {
  
  
  

Mime
View raw message