rbb 99/10/12 05:55:12
Modified: src/lib/apr/locks/unix intraproc.c Log: Fix some bugs introduced yesterday. Most pthreads functions (at least the mutex ones) return 0 for success and an error value on error, just like APR. This change allows us to take advantage of this fact, and keeps us from returning success when it was actually an error. Revision Changes Path 1.4 +2 -11 apache-2.0/src/lib/apr/locks/unix/intraproc.c Index: intraproc.c =================================================================== RCS file: /home/cvs/apache-2.0/src/lib/apr/locks/unix/intraproc.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- intraproc.c 1999/10/12 06:14:45 1.3 +++ intraproc.c 1999/10/12 12:55:11 1.4 @@ -62,14 +62,10 @@ ap_status_t lock_intra_cleanup(void *data) { - ap_status_t stat; struct lock_t *lock = (struct lock_t *) data; if (lock->curr_locked == 1) { - if ((stat = pthread_mutex_unlock(lock->intraproc)) == 0) { - return stat; - } + return pthread_mutex_unlock(lock->intraproc); } - return APR_SUCCESS; } ap_status_t create_intra_lock(struct lock_t *new) @@ -105,13 +101,8 @@ ap_status_t lock_intra(struct lock_t *lock) { - ap_status_t stat; - lock->curr_locked = 1; - if ((stat = pthread_mutex_lock(lock->intraproc)) == 0) { - return stat; - } - return APR_SUCCESS; + return pthread_mutex_lock(lock->intraproc); } ap_status_t unlock_intra(struct lock_t *lock)