You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by tr...@apache.org on 2002/04/01 23:03:04 UTC

cvs commit: apr/locks/unix proc_mutex.c

trawick     02/04/01 13:03:04

  Modified:    .        CHANGES
               locks/unix proc_mutex.c
  Log:
  Get flock-based mutexes to work in apps like Apache.  Use the
  same permissions on flock- and fcntl-based mutexes as Apache
  1.3.
  
  Revision  Changes    Path
  1.251     +4 -0      apr/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/apr/CHANGES,v
  retrieving revision 1.250
  retrieving revision 1.251
  diff -u -r1.250 -r1.251
  --- CHANGES	1 Apr 2002 19:30:27 -0000	1.250
  +++ CHANGES	1 Apr 2002 21:03:04 -0000	1.251
  @@ -1,5 +1,9 @@
   Changes with APR b1
   
  +  *) Get flock-based mutexes to work in apps like Apache.  Use the
  +     same permissions on flock- and fcntl-based mutexes as Apache
  +     1.3.  [Jeff Trawick]
  +
     *) Fix apr-config so that it will not attempt to cd to a non-existent
        directory.  [Justin Erenkrantz]
   
  
  
  
  1.13      +6 -4      apr/locks/unix/proc_mutex.c
  
  Index: proc_mutex.c
  ===================================================================
  RCS file: /home/cvs/apr/locks/unix/proc_mutex.c,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- proc_mutex.c	13 Mar 2002 20:39:21 -0000	1.12
  +++ proc_mutex.c	1 Apr 2002 21:03:04 -0000	1.13
  @@ -390,7 +390,8 @@
       if (fname) {
           new_mutex->fname = apr_pstrdup(new_mutex->pool, fname);
           rv = apr_file_open(&new_mutex->interproc, new_mutex->fname,
  -                           APR_CREATE | APR_WRITE | APR_EXCL, 0644, 
  +                           APR_CREATE | APR_WRITE | APR_EXCL, 
  +                           APR_UREAD | APR_UWRITE | APR_GREAD | APR_WREAD,
                              new_mutex->pool);
       }
       else {
  @@ -511,7 +512,8 @@
       if (fname) {
           new_mutex->fname = apr_pstrdup(new_mutex->pool, fname);
           rv = apr_file_open(&new_mutex->interproc, new_mutex->fname,
  -                           APR_CREATE | APR_WRITE | APR_EXCL, 0644, 
  +                           APR_CREATE | APR_WRITE | APR_EXCL, 
  +                           APR_UREAD | APR_UWRITE,
                              new_mutex->pool);
       }
       else {
  @@ -582,10 +584,10 @@
       new_mutex->pool = pool;
       new_mutex->fname = apr_pstrdup(pool, fname);
       rv = apr_file_open(&new_mutex->interproc, new_mutex->fname,
  -                       APR_CREATE | APR_WRITE, 0600, new_mutex->pool);
  +                       APR_WRITE, 0, new_mutex->pool);
       if (rv != APR_SUCCESS) {
           proc_mutex_flock_destroy(new_mutex);
  -        return errno;
  +        return rv;
       }
       *mutex = new_mutex;
       return APR_SUCCESS;
  
  
  

Re: cvs commit: apr/locks/unix proc_mutex.c

Posted by Greg Ames <gr...@remulak.net>.
trawick@apache.org wrote:
> 
> trawick     02/04/01 13:03:04
> 
>   Modified:    .        CHANGES
>                locks/unix proc_mutex.c
>   Log:
>   Get flock-based mutexes to work in apps like Apache.  Use the
>   same permissions on flock- and fcntl-based mutexes as Apache
>   1.3.

dang, you're fast!  I'll test and back out my commit to apr_hints.m4 & STATUS.

Greg

Additional inter-process locking mechanism...

Posted by Pier Fumagalli <pi...@betaversion.org>.
Is someone digging into proc_mutex locking using the set of sem_xxxx
functions (POSIX semaphores)? It would be cute for systems such as Darwin
where the only option is flock()/fcntl()...

    Pier