From 49ab777bbbbb90173209a82310ba552ed4ceb528 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Tue, 2 Apr 2002 11:51:05 +0000 Subject: [PATCH] minor improvement --- servers/slapd/back-monitor/back-monitor.h | 2 +- servers/slapd/back-monitor/cache.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/servers/slapd/back-monitor/back-monitor.h b/servers/slapd/back-monitor/back-monitor.h index bb1bd74b98..511facdd79 100644 --- a/servers/slapd/back-monitor/back-monitor.h +++ b/servers/slapd/back-monitor/back-monitor.h @@ -48,7 +48,7 @@ LDAP_BEGIN_DECL * selection. */ struct monitorcache { - struct berval *mc_ndn; + struct berval mc_ndn; Entry *mc_e; }; diff --git a/servers/slapd/back-monitor/cache.c b/servers/slapd/back-monitor/cache.c index e55931b118..b00b55ed04 100644 --- a/servers/slapd/back-monitor/cache.c +++ b/servers/slapd/back-monitor/cache.c @@ -54,7 +54,7 @@ monitor_cache_cmp( /* * case sensitive, because the dn MUST be normalized */ - return ber_bvcmp( cc1->mc_ndn, cc2->mc_ndn ); + return ber_bvcmp( &cc1->mc_ndn, &cc2->mc_ndn ); } /* @@ -72,7 +72,7 @@ monitor_cache_dup( /* * case sensitive, because the dn MUST be normalized */ - return ber_bvcmp( cc1->mc_ndn, cc2->mc_ndn ) == 0 ? -1 : 0; + return ber_bvcmp( &cc1->mc_ndn, &cc2->mc_ndn ) == 0 ? -1 : 0; } /* @@ -95,7 +95,7 @@ monitor_cache_add( ldap_pvt_thread_mutex_init( &mp->mp_mutex ); mc = ( struct monitorcache * )ch_malloc( sizeof( struct monitorcache ) ); - mc->mc_ndn = &e->e_nname; + mc->mc_ndn = e->e_nname; mc->mc_e = e; ldap_pvt_thread_mutex_lock( &mi->mi_cache_mutex ); rc = avl_insert( &mi->mi_cache, ( caddr_t )mc, @@ -141,7 +141,7 @@ monitor_cache_get( assert( ndn != NULL ); assert( ep != NULL ); - tmp_mc.mc_ndn = ndn; + tmp_mc.mc_ndn = *ndn; ldap_pvt_thread_mutex_lock( &mi->mi_cache_mutex ); mc = ( struct monitorcache * )avl_find( mi->mi_cache, ( caddr_t )&tmp_mc, monitor_cache_cmp ); @@ -251,7 +251,7 @@ monitor_cache_release( /* volatile entries do not return to cache */ ldap_pvt_thread_mutex_lock( &mi->mi_cache_mutex ); - tmp_mc.mc_ndn = &e->e_nname; + tmp_mc.mc_ndn = e->e_nname; mc = avl_delete( &mi->mi_cache, ( caddr_t )&tmp_mc, monitor_cache_cmp ); ldap_pvt_thread_mutex_unlock( &mi->mi_cache_mutex ); -- 2.39.5