Enclose debug variables in #ifdef LDAP_DEBUG

This commit is contained in:
Hallvard Furuseth 1998-11-05 05:03:12 +00:00
parent c6e48d6770
commit 83ec12246e
6 changed files with 15 additions and 2 deletions

View file

@ -92,7 +92,9 @@ struct berval {
char *bv_val;
};
#ifdef LDAP_DEBUG
extern int lber_debug;
#endif
/*
* in bprint.c:

View file

@ -67,7 +67,9 @@ LDAP_BEGIN_DECL
#define LDAP_OPT_SUCCESS 0
#define LDAP_OPT_ERROR (-1)
#ifdef LDAP_DEBUG
extern int ldap_debug;
#endif
#define LDAP_API_INFO_VERSION 1
typedef struct ldapapiinfo {

View file

@ -293,9 +293,10 @@ parse_acl(
} else {
if (ldap_debug&LDAP_DEBUG_ACL)
#ifdef LDAP_DEBUG
if (ldap_debug & LDAP_DEBUG_ACL)
print_acl(a);
#endif
if ( a->acl_access == NULL ) {
fprintf( stderr,

View file

@ -198,7 +198,9 @@ cache_add_entry_lock(
e = cache->c_lrutail;
/* XXX check for writer lock - should also check no readers pending */
#ifdef LDAP_DEBUG
assert(pthread_rdwr_wchk_np(&e->e_rdwr));
#endif
/* delete from cache and lru q */
rc = cache_delete_entry_internal( cache, e );
@ -394,7 +396,9 @@ cache_delete_entry(
Debug( LDAP_DEBUG_TRACE, "====> cache_delete_entry:\n", 0, 0, 0 );
/* XXX check for writer lock - should also check no readers pending */
#ifdef LDAP_DEBUG
assert(pthread_rdwr_wchk_np(&e->e_rdwr));
#endif
/* set cache mutex */
pthread_mutex_lock( &cache->c_mutex );

View file

@ -74,7 +74,9 @@ id2entry_delete( Backend *be, Entry *e )
e->e_dn, 0 );
/* XXX - check for writer lock - should also check no reader pending */
#ifdef LDAP_DEBUG
assert(pthread_rdwr_wchk_np(&e->e_rdwr));
#endif
#ifdef HAVE_BERKELEY_DB2
memset( &key, 0, sizeof( key ) );

View file

@ -195,8 +195,10 @@ entry_free( Entry *e )
Attribute *a, *next;
/* XXX check that no reader/writer locks exist */
#ifdef LDAP_DEBUG
assert( !pthread_rdwr_wchk_np(&e->e_rdwr) &&
!pthread_rdwr_rchk_np(&e->e_rdwr) );
#endif
if ( e->e_dn != NULL ) {
free( e->e_dn );