apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject cvs commit: apr/locks/unix proc_mutex.c
Date Sat, 19 Apr 2003 02:33:14 GMT
trawick     2003/04/18 19:33:13

  Modified:    .        CHANGES
               locks/unix proc_mutex.c
  Log:
  Don't segfault trying to close a file in error paths of flock
  and fcntl mutex creation.
  
  PR:             19036
  
  Revision  Changes    Path
  1.402     +3 -0      apr/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/apr/CHANGES,v
  retrieving revision 1.401
  retrieving revision 1.402
  diff -u -r1.401 -r1.402
  --- CHANGES	17 Apr 2003 17:31:54 -0000	1.401
  +++ CHANGES	19 Apr 2003 02:33:13 -0000	1.402
  @@ -1,5 +1,8 @@
   Changes with APR 0.9.4
   
  +  *) Don't segfault trying to close a file in error paths of flock
  +     and fcntl mutex creation.  PR 19036  [Jeff Trawick]
  +
     *) Add %pT support to apr_snprintf() for printing an apr_os_thread_t.
        [Jeff Trawick]
   
  
  
  
  1.30      +6 -3      apr/locks/unix/proc_mutex.c
  
  Index: proc_mutex.c
  ===================================================================
  RCS file: /home/cvs/apr/locks/unix/proc_mutex.c,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- proc_mutex.c	27 Mar 2003 20:10:35 -0000	1.29
  +++ proc_mutex.c	19 Apr 2003 02:33:13 -0000	1.30
  @@ -496,8 +496,9 @@
           if (status != APR_SUCCESS)
               return status;
       }
  -    apr_file_close(mutex->interproc);
  -    
  +    if (mutex->interproc) { /* if it was opened successfully */
  +        apr_file_close(mutex->interproc);
  +    }
       return APR_SUCCESS;
   }    
   
  @@ -609,7 +610,9 @@
           if (status != APR_SUCCESS)
               return status;
       }
  -    apr_file_close(mutex->interproc);
  +    if (mutex->interproc) { /* if it was opened properly */
  +        apr_file_close(mutex->interproc);
  +    }
       unlink(mutex->fname);
       return APR_SUCCESS;
   }    
  
  
  

Mime
View raw message