]> git.sur5r.net Git - openldap/commitdiff
ITS#6625 Remove some LDAP_R_COMPILEs
authorHallvard Furuseth <hallvard@openldap.org>
Mon, 6 Dec 2010 11:31:58 +0000 (11:31 +0000)
committerHallvard Furuseth <hallvard@openldap.org>
Mon, 6 Dec 2010 11:31:58 +0000 (11:31 +0000)
libraries/libldap/gssapi.c
libraries/libldap/tls2.c
libraries/libldap/tls_g.c
libraries/libldap/tls_m.c
libraries/libldap/tls_o.c

index 7e9a4406c80a98550499a776b6336cb24927b4a5..faa43ba45e2e000ca3a0397dd63c5c056c7bfdc0 100644 (file)
@@ -664,9 +664,7 @@ ldap_int_gss_spnego_bind_s( LDAP *ld )
        gss_buffer_desc input_token, output_token = GSS_C_EMPTY_BUFFER;
        struct berval cred, *scred = NULL;
 
-#ifdef LDAP_R_COMPILE
-       ldap_pvt_thread_mutex_lock( &ldap_int_gssapi_mutex );
-#endif
+       LDAP_MUTEX_LOCK( &ldap_int_gssapi_mutex );
 
        /* get information from RootDSE entry */
        rc = ldap_gssapi_get_rootdse_infos ( ld, &mechlist,
@@ -784,9 +782,7 @@ gss_error:
                              (ret_mech != GSS_C_NO_OID ? ret_mech : req_mech ),
                              gss_rc, minor_status );
 rc_error:
-#ifdef LDAP_R_COMPILE
-       ldap_pvt_thread_mutex_unlock( &ldap_int_gssapi_mutex );
-#endif
+       LDAP_MUTEX_UNLOCK( &ldap_int_gssapi_mutex );
        LDAP_FREE( mechlist );
        LDAP_FREE( ldapServiceName );
        LDAP_FREE( dnsHostName );
index 91ca8d8bb8425470d30df1074cbb85da5c0af901..f258bbbd530e382f2761cc2ccc74061ec004c0d0 100644 (file)
 
 #include "ldap-tls.h"
 
-#ifdef LDAP_R_COMPILE
-#include <ldap_pvt_thread.h>
-#endif
-
 static tls_impl *tls_imp = &ldap_int_tls_impl;
 #define HAS_TLS( sb )  ber_sockbuf_ctrl( sb, LBER_SB_OPT_HAS_IO, \
                                (void *)tls_imp->ti_sbio )
@@ -269,13 +265,9 @@ ldap_pvt_tls_init_def_ctx( int is_server )
 {
        struct ldapoptions *lo = LDAP_INT_GLOBAL_OPT();   
        int rc;
-#ifdef LDAP_R_COMPILE
-       ldap_pvt_thread_mutex_lock( &tls_def_ctx_mutex );
-#endif
+       LDAP_MUTEX_LOCK( &tls_def_ctx_mutex );
        rc = ldap_int_tls_init_ctx( lo, is_server );
-#ifdef LDAP_R_COMPILE
-       ldap_pvt_thread_mutex_unlock( &tls_def_ctx_mutex );
-#endif
+       LDAP_MUTEX_UNLOCK( &tls_def_ctx_mutex );
        return rc;
 }
 
index f5076cdb99c90b8389a4a74def8c08eb97e62227..e613b80c4f097a860ae8075dc83f9faf7e45d699 100644 (file)
 #include "ldap-int.h"
 #include "ldap-tls.h"
 
-#ifdef LDAP_R_COMPILE
-#include <ldap_pvt_thread.h>
-#endif
-
 #include <gnutls/gnutls.h>
 #include <gnutls/x509.h>
 #include <gcrypt.h>
@@ -257,13 +253,9 @@ static void
 tlsg_ctx_ref( tls_ctx *ctx )
 {
        tlsg_ctx *c = (tlsg_ctx *)ctx;
-#ifdef LDAP_R_COMPILE
-       ldap_pvt_thread_mutex_lock( &c->ref_mutex );
-#endif
+       LDAP_MUTEX_LOCK( &c->ref_mutex );
        c->refcount++;
-#ifdef LDAP_R_COMPILE
-       ldap_pvt_thread_mutex_unlock( &c->ref_mutex );
-#endif
+       LDAP_MUTEX_UNLOCK( &c->ref_mutex );
 }
 
 static void
@@ -274,13 +266,9 @@ tlsg_ctx_free ( tls_ctx *ctx )
 
        if ( !c ) return;
 
-#ifdef LDAP_R_COMPILE
-       ldap_pvt_thread_mutex_lock( &c->ref_mutex );
-#endif
+       LDAP_MUTEX_LOCK( &c->ref_mutex );
        refcount = --c->refcount;
-#ifdef LDAP_R_COMPILE
-       ldap_pvt_thread_mutex_unlock( &c->ref_mutex );
-#endif
+       LDAP_MUTEX_UNLOCK( &c->ref_mutex );
        if ( refcount )
                return;
 #ifdef HAVE_CIPHERSUITES
index 62d0f7792dbbd40e1019867cd5ec6ea930c04170..7d5e37e20f873c16695f5d4aeb03210e82269c9e 100644 (file)
 #include "ldap-int.h"
 #include "ldap-tls.h"
 
-#ifdef LDAP_R_COMPILE
-#include <ldap_pvt_thread.h>
-#endif
-
 #define READ_PASSWORD_FROM_STDIN
 #define READ_PASSWORD_FROM_FILE
 
@@ -1772,13 +1768,9 @@ static void
 tlsm_ctx_ref( tls_ctx *ctx )
 {
        tlsm_ctx *c = (tlsm_ctx *)ctx;
-#ifdef LDAP_R_COMPILE
-       ldap_pvt_thread_mutex_lock( &c->tc_refmutex );
-#endif
+       LDAP_MUTEX_LOCK( &c->tc_refmutex );
        c->tc_refcnt++;
-#ifdef LDAP_R_COMPILE
-       ldap_pvt_thread_mutex_unlock( &c->tc_refmutex );
-#endif
+       LDAP_MUTEX_UNLOCK( &c->tc_refmutex );
 }
 
 static void
@@ -1789,13 +1781,9 @@ tlsm_ctx_free ( tls_ctx *ctx )
 
        if ( !c ) return;
 
-#ifdef LDAP_R_COMPILE
-       ldap_pvt_thread_mutex_lock( &c->tc_refmutex );
-#endif
+       LDAP_MUTEX_LOCK( &c->tc_refmutex );
        refcount = --c->tc_refcnt;
-#ifdef LDAP_R_COMPILE
-       ldap_pvt_thread_mutex_unlock( &c->tc_refmutex );
-#endif
+       LDAP_MUTEX_UNLOCK( &c->tc_refmutex );
        if ( refcount )
                return;
        if ( c->tc_model )
index d70d7b88f307a9e567950cc537bce0d5199a44cb..b9474fa9ff17b8f8e39f9b2b65f15b4d666b3bdb 100644 (file)
 #include "ldap-int.h"
 #include "ldap-tls.h"
 
-#ifdef LDAP_R_COMPILE
-#include <ldap_pvt_thread.h>
-#endif
-
 #ifdef HAVE_OPENSSL_SSL_H
 #include <openssl/ssl.h>
 #include <openssl/x509v3.h>
@@ -1214,14 +1210,10 @@ tlso_tmp_dh_cb( SSL *ssl, int is_export, int key_length )
        int i;
 
        /* Do we have params of this length already? */
-#ifdef LDAP_R_COMPILE
-       ldap_pvt_thread_mutex_lock( &tlso_dh_mutex );
-#endif
+       LDAP_MUTEX_LOCK( &tlso_dh_mutex );
        for ( p = tlso_dhparams; p; p=p->next ) {
                if ( p->keylength == key_length ) {
-#ifdef LDAP_R_COMPILE
-                       ldap_pvt_thread_mutex_unlock( &tlso_dh_mutex );
-#endif
+                       LDAP_MUTEX_UNLOCK( &tlso_dh_mutex );
                        return p->param;
                }
        }
@@ -1254,9 +1246,7 @@ tlso_tmp_dh_cb( SSL *ssl, int is_export, int key_length )
                }
        }
 
-#ifdef LDAP_R_COMPILE
-       ldap_pvt_thread_mutex_unlock( &tlso_dh_mutex );
-#endif
+       LDAP_MUTEX_UNLOCK( &tlso_dh_mutex );
        return dh;
 }