From 864f05497e23f8884652c061209a730458512c53 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Thu, 29 Aug 2002 17:45:12 +0000 Subject: [PATCH] allow different solutions to debug sasl shutdown --- libraries/libldap/cyrus.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/libraries/libldap/cyrus.c b/libraries/libldap/cyrus.c index b0dce244d0..85b248de67 100644 --- a/libraries/libldap/cyrus.c +++ b/libraries/libldap/cyrus.c @@ -1093,6 +1093,7 @@ ldap_int_sasl_set_option( LDAP *ld, int option, void *arg ) } #ifdef LDAP_R_COMPILE +#define LDAP_DEBUG_R_SASL void *ldap_pvt_sasl_mutex_new(void) { ldap_pvt_thread_mutex_t *mutex; @@ -1103,27 +1104,47 @@ void *ldap_pvt_sasl_mutex_new(void) if ( ldap_pvt_thread_mutex_init( mutex ) == 0 ) { return mutex; } +#ifndef LDAP_DEBUG_R_SASL assert( 0 ); +#endif /* !LDAP_DEBUG_R_SASL */ return NULL; } int ldap_pvt_sasl_mutex_lock(void *mutex) { +#ifdef LDAP_DEBUG_R_SASL + if ( mutex == NULL ) { + return SASL_OK; + } +#else /* !LDAP_DEBUG_R_SASL */ assert( mutex ); +#endif /* !LDAP_DEBUG_R_SASL */ return ldap_pvt_thread_mutex_lock( (ldap_pvt_thread_mutex_t *)mutex ) ? SASL_FAIL : SASL_OK; } int ldap_pvt_sasl_mutex_unlock(void *mutex) { +#ifdef LDAP_DEBUG_R_SASL + if ( mutex == NULL ) { + return SASL_OK; + } +#else /* !LDAP_DEBUG_R_SASL */ assert( mutex ); +#endif /* !LDAP_DEBUG_R_SASL */ return ldap_pvt_thread_mutex_unlock( (ldap_pvt_thread_mutex_t *)mutex ) ? SASL_FAIL : SASL_OK; } void ldap_pvt_sasl_mutex_dispose(void *mutex) { +#ifdef LDAP_DEBUG_R_SASL + if ( mutex == NULL ) { + return; + } +#else /* !LDAP_DEBUG_R_SASL */ assert( mutex ); +#endif /* !LDAP_DEBUG_R_SASL */ (void) ldap_pvt_thread_mutex_destroy( (ldap_pvt_thread_mutex_t *)mutex ); LDAP_FREE( mutex ); } -- 2.39.5