You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by aa...@apache.org on 2002/05/06 20:19:53 UTC

cvs commit: httpd-2.0/os/unix unixd.c unixd.h

aaron       02/05/06 11:19:53

  Modified:    os/unix  unixd.c unixd.h
  Log:
  Add unixd_set_global_mutex_perms so we can set permissions on things like
  SysV Semaphores in the core and modules.
  
  Revision  Changes    Path
  1.50      +12 -0     httpd-2.0/os/unix/unixd.c
  
  Index: unixd.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/os/unix/unixd.c,v
  retrieving revision 1.49
  retrieving revision 1.50
  diff -u -r1.49 -r1.50
  --- unixd.c	25 Apr 2002 07:18:40 -0000	1.49
  +++ unixd.c	6 May 2002 18:19:53 -0000	1.50
  @@ -414,6 +414,18 @@
       return APR_SUCCESS;
   }
   
  +AP_DECLARE(apr_status_t) unixd_set_global_mutex_perms(apr_global_mutex_t *gmutex)
  +{
  +#if !APR_PROCESS_LOCK_IS_GLOBAL
  +    apr_os_global_mutex_t osgmutex;
  +    apr_os_global_mutex_get(&osgmutex, gmutex);
  +    return unixd_set_proc_mutex_perms(osgmutex.proc_mutex);
  +#else  /* APR_PROCESS_LOCK_IS_GLOBAL */
  +    /* In this case, apr_proc_mutex_t and apr_global_mutex_t are the same. */
  +    return unixd_set_proc_mutex_perms((apr_proc_mutex_t *)gmutex);
  +#endif /* APR_PROCESS_LOCK_IS_GLOBAL */
  +}
  +
   AP_DECLARE(apr_status_t) unixd_accept(void **accepted, ap_listen_rec *lr,
                                           apr_pool_t *ptrans)
   {
  
  
  
  1.36      +2 -0      httpd-2.0/os/unix/unixd.h
  
  Index: unixd.h
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/os/unix/unixd.h,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- unixd.h	25 Apr 2002 07:18:40 -0000	1.35
  +++ unixd.h	6 May 2002 18:19:53 -0000	1.36
  @@ -71,6 +71,7 @@
   #include "apr_hooks.h"
   #include "apr_thread_proc.h"
   #include "apr_proc_mutex.h"
  +#include "apr_global_mutex.h"
   
   #include <pwd.h>
   #include <grp.h>
  @@ -120,6 +121,7 @@
                              const char *arg, const char * arg2, int type);
   #endif
   AP_DECLARE(apr_status_t) unixd_set_proc_mutex_perms(apr_proc_mutex_t *pmutex);
  +AP_DECLARE(apr_status_t) unixd_set_global_mutex_perms(apr_global_mutex_t *gmutex);
   AP_DECLARE(apr_status_t) unixd_accept(void **accepted, ap_listen_rec *lr, apr_pool_t *ptrans);
   
   #ifdef HAVE_KILLPG
  
  
  

Re: cvs commit: httpd-2.0/os/unix unixd.c unixd.h

Posted by Jeff Trawick <tr...@attglobal.net>.
aaron@apache.org writes:

> aaron       02/05/06 11:19:53
> 
>   Modified:    os/unix  unixd.c unixd.h
>   Log:
>   Add unixd_set_global_mutex_perms so we can set permissions on things like
>   SysV Semaphores in the core and modules.
>   
>   Revision  Changes    Path
>   1.50      +12 -0     httpd-2.0/os/unix/unixd.c
>   
>   Index: unixd.c
>   ===================================================================
>   RCS file: /home/cvs/httpd-2.0/os/unix/unixd.c,v
>   retrieving revision 1.49
>   retrieving revision 1.50
>   diff -u -r1.49 -r1.50
>   --- unixd.c	25 Apr 2002 07:18:40 -0000	1.49
>   +++ unixd.c	6 May 2002 18:19:53 -0000	1.50
>   @@ -414,6 +414,18 @@
>        return APR_SUCCESS;
>    }
>    
>   +AP_DECLARE(apr_status_t) unixd_set_global_mutex_perms(apr_global_mutex_t *gmutex)
>   +{
>   +#if !APR_PROCESS_LOCK_IS_GLOBAL

I think that should instead be

#if !APR_PROC_MUTEX_IS_GLOBAL

APR_PROCESS_LOCK_IS_GLOBAL and APR_PROC_MUTEX_IS_GLOBAL are different
things (though maybe their relationship needs to be straightened
out)...  apr_global_mutex_t is distinct from apr_proc_mutex_t if
only APR_PROCESS_LOCK_IS_GLOBAL is set, whereas it is not if
APR_PROC_MUTEX_IS_GLOBAL is set.

If it really worked, the typecast below (which hides an eventual
segfault, or at least a bogus use of storage) wouldn't be necessary:

  +#else  /* APR_PROCESS_LOCK_IS_GLOBAL */
  +    /* In this case, apr_proc_mutex_t and apr_global_mutex_t are the same. */
  +    return unixd_set_proc_mutex_perms((apr_proc_mutex_t *)gmutex);

It looks like apr_portable.h has the two confused too.

(still playing with it... hopefully this is the extent of the
confusion...)
-- 
Jeff Trawick | trawick@attglobal.net
Born in Roswell... married an alien...








Re: cvs commit: httpd-2.0/os/unix unixd.c unixd.h

Posted by Aaron Bannert <aa...@clove.org>.
On Mon, May 06, 2002 at 06:19:53PM -0000, aaron@apache.org wrote:
> aaron       02/05/06 11:19:53
> 
>   Modified:    os/unix  unixd.c unixd.h
>   Log:
>   Add unixd_set_global_mutex_perms so we can set permissions on things like
>   SysV Semaphores in the core and modules.

I checked that this compiles whether APR_PROCESS_LOCK_IS_GLOBAL is defined
or not, but only really tested when it is not defined. If you're on one
of those other systems, please holler if it's broken.

-aaron

Re: cvs commit: httpd-2.0/os/unix unixd.c unixd.h

Posted by Jeff Trawick <tr...@attglobal.net>.
aaron@apache.org writes:

> aaron       02/05/06 11:19:53
> 
>   Modified:    os/unix  unixd.c unixd.h
>   Log:
>   Add unixd_set_global_mutex_perms so we can set permissions on things like
>   SysV Semaphores in the core and modules.
>   
>   Revision  Changes    Path
>   1.50      +12 -0     httpd-2.0/os/unix/unixd.c
>   
>   Index: unixd.c
>   ===================================================================
>   RCS file: /home/cvs/httpd-2.0/os/unix/unixd.c,v
>   retrieving revision 1.49
>   retrieving revision 1.50
>   diff -u -r1.49 -r1.50
>   --- unixd.c	25 Apr 2002 07:18:40 -0000	1.49
>   +++ unixd.c	6 May 2002 18:19:53 -0000	1.50
>   @@ -414,6 +414,18 @@
>        return APR_SUCCESS;
>    }
>    
>   +AP_DECLARE(apr_status_t) unixd_set_global_mutex_perms(apr_global_mutex_t *gmutex)
>   +{
>   +#if !APR_PROCESS_LOCK_IS_GLOBAL

I think that should instead be

#if !APR_PROC_MUTEX_IS_GLOBAL

APR_PROCESS_LOCK_IS_GLOBAL and APR_PROC_MUTEX_IS_GLOBAL are different
things (though maybe their relationship needs to be straightened
out)...  apr_global_mutex_t is distinct from apr_proc_mutex_t if
only APR_PROCESS_LOCK_IS_GLOBAL is set, whereas it is not if
APR_PROC_MUTEX_IS_GLOBAL is set.

If it really worked, the typecast below (which hides an eventual
segfault, or at least a bogus use of storage) wouldn't be necessary:

  +#else  /* APR_PROCESS_LOCK_IS_GLOBAL */
  +    /* In this case, apr_proc_mutex_t and apr_global_mutex_t are the same. */
  +    return unixd_set_proc_mutex_perms((apr_proc_mutex_t *)gmutex);

It looks like apr_portable.h has the two confused too.

(still playing with it... hopefully this is the extent of the
confusion...)
-- 
Jeff Trawick | trawick@attglobal.net
Born in Roswell... married an alien...