httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@locus.apache.org
Subject cvs commit: apache-2.0/src/lib/apr/locks/unix crossproc.c
Date Fri, 21 Jul 2000 16:48:29 GMT
trawick     00/07/21 09:48:28

  Modified:    src/lib/apr/locks/unix crossproc.c
  Log:
  Fix some error-trapping logic in the APR_USE_PROC_PTHREAD_SERIALIZE
  implementation.
  
  Revision  Changes    Path
  1.34      +13 -13    apache-2.0/src/lib/apr/locks/unix/crossproc.c
  
  Index: crossproc.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/locks/unix/crossproc.c,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- crossproc.c	2000/07/19 17:42:55	1.33
  +++ crossproc.c	2000/07/21 16:48:28	1.34
  @@ -185,22 +185,25 @@
           return errno;
       }
       close(fd);
  -    if ((stat = pthread_mutexattr_init(&mattr))) {
  +    if (pthread_mutexattr_init(&mattr)) {
  +        stat = errno;
           lock_cleanup(new);
           return stat;
       }
  -    if ((stat = pthread_mutexattr_setpshared(&mattr, 
  -                                              PTHREAD_PROCESS_SHARED))) {
  +    if (pthread_mutexattr_setpshared(&mattr, PTHREAD_PROCESS_SHARED)) {
  +        stat = errno;
           lock_cleanup(new);
           return stat;
       }
   
  -    if ((stat = pthread_mutex_init(new->interproc, &mattr))) {
  +    if (pthread_mutex_init(new->interproc, &mattr)) {
  +        stat = errno;
           lock_cleanup(new);
           return stat;
       }
   
  -    if ((stat = pthread_mutexattr_destroy(&mattr))) {
  +    if (pthread_mutexattr_destroy(&mattr)) {
  +        stat = errno;
           lock_cleanup(new);
           return stat;
       }
  @@ -212,20 +215,17 @@
   
   ap_status_t ap_unix_lock_inter(ap_lock_t *lock)
   {
  -    ap_status_t stat;
  -    lock->curr_locked = 1;
  -    if (stat = pthread_mutex_lock(lock->interproc)) {
  -        return stat;
  +    if (pthread_mutex_lock(lock->interproc)) {
  +        return errno;
       }
  +    lock->curr_locked = 1;
       return APR_SUCCESS;
   }
   
   ap_status_t ap_unix_unlock_inter(ap_lock_t *lock)
   {
  -    ap_status_t stat;
  -
  -    if (stat = pthread_mutex_unlock(lock->interproc)) {
  -        return stat;
  +    if (pthread_mutex_unlock(lock->interproc)) {
  +        return errno;
       }
       lock->curr_locked = 0;
       return APR_SUCCESS;
  
  
  

Mime
View raw message