From: Pierangelo Masarati Date: Tue, 12 Sep 2006 07:53:19 +0000 (+0000) Subject: leave monitor calls in place, hide contents; in the long run, enable monitor and... X-Git-Tag: OPENLDAP_REL_ENG_2_3_MP~165 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=6300e449d83badf89a085599ef43d51d6edcc950;p=openldap leave monitor calls in place, hide contents; in the long run, enable monitor and build as static by default --- diff --git a/servers/slapd/back-bdb/init.c b/servers/slapd/back-bdb/init.c index 20826b2045..7b85509c7b 100644 --- a/servers/slapd/back-bdb/init.c +++ b/servers/slapd/back-bdb/init.c @@ -81,11 +81,7 @@ bdb_db_init( BackendDB *be ) be->be_private = bdb; be->be_cf_ocs = be->bd_info->bi_cf_ocs; -#ifdef SLAPD_MONITOR rc = bdb_monitor_init( be ); -#else - rc = 0; -#endif return rc; } @@ -429,13 +425,11 @@ bdb_db_open( BackendDB *be ) XLOCK_ID(bdb->bi_dbenv, &bdb->bi_cache.c_locker); } -#ifdef SLAPD_MONITOR /* monitor setup */ rc = bdb_monitor_open( be ); if ( rc != 0 ) { goto fail; } -#endif bdb->bi_flags |= BDB_IS_OPEN; @@ -456,10 +450,8 @@ bdb_db_close( BackendDB *be ) struct bdb_db_info *db; bdb_idl_cache_entry_t *entry, *next_entry; -#ifdef SLAPD_MONITOR /* monitor handling */ (void)bdb_monitor_close( be ); -#endif bdb->bi_flags &= ~BDB_IS_OPEN; @@ -683,7 +675,6 @@ bdb_back_initialize( bi->bi_connection_init = 0; bi->bi_connection_destroy = 0; -#ifdef SLAPD_MONITOR /* * initialize monitor stuff */ @@ -691,7 +682,6 @@ bdb_back_initialize( if ( rc ) { return rc; } -#endif rc = bdb_back_init_cf( bi ); diff --git a/servers/slapd/back-bdb/monitor.c b/servers/slapd/back-bdb/monitor.c index e5720010a8..2dc0c93dd4 100644 --- a/servers/slapd/back-bdb/monitor.c +++ b/servers/slapd/back-bdb/monitor.c @@ -16,8 +16,6 @@ #include "portable.h" -#ifdef SLAPD_MONITOR - #include #include #include @@ -26,6 +24,9 @@ #include #include "lutil.h" #include "back-bdb.h" + +#ifdef SLAPD_MONITOR + #include "../back-monitor/back-monitor.h" static ObjectClass *oc_olmBDBDatabase; @@ -160,8 +161,6 @@ bdb_monitor_modify( Entry *e, void *priv ) { - struct bdb_info *bdb = (struct bdb_info *) priv; - return SLAP_CB_CONTINUE; } @@ -170,8 +169,6 @@ bdb_monitor_free( Entry *e, void *priv ) { - struct bdb_info *bdb = (struct bdb_info *) priv; - struct berval values[ 2 ]; Modification mod = { 0 }; @@ -203,12 +200,15 @@ bdb_monitor_free( return SLAP_CB_CONTINUE; } +#endif /* SLAPD_MONITOR */ + /* * call from within bdb_initialize() */ int bdb_monitor_initialize( void ) { +#ifdef SLAPD_MONITOR int i, code; const char *err; @@ -322,6 +322,7 @@ done_oc:; ldap_memfree( oc ); } +#endif /* SLAPD_MONITOR */ return 0; } @@ -332,7 +333,9 @@ done_oc:; int bdb_monitor_init( BackendDB *be ) { +#ifdef SLAPD_MONITOR SLAP_DBFLAGS( be ) |= SLAP_DBFLAG_MONITORING; +#endif /* SLAPD_MONITOR */ return 0; } @@ -343,6 +346,7 @@ bdb_monitor_init( BackendDB *be ) int bdb_monitor_open( BackendDB *be ) { +#ifdef SLAPD_MONITOR struct bdb_info *bdb = (struct bdb_info *) be->be_private; Attribute *a, *next; monitor_callback_t *cb = NULL; @@ -517,6 +521,9 @@ cleanup:; } return rc; +#else /* !SLAPD_MONITOR */ + return 0; +#endif /* SLAPD_MONITOR */ } /* @@ -525,6 +532,7 @@ cleanup:; int bdb_monitor_close( BackendDB *be ) { +#ifdef SLAPD_MONITOR struct bdb_info *bdb = (struct bdb_info *) be->be_private; if ( !BER_BVISNULL( &bdb->bi_monitor.bdm_filter ) ) { @@ -540,6 +548,7 @@ bdb_monitor_close( BackendDB *be ) memset( &bdb->bi_monitor, 0, sizeof( bdb->bi_monitor ) ); } +#endif /* SLAPD_MONITOR */ return 0; } @@ -552,5 +561,3 @@ bdb_monitor_destroy( BackendDB *be ) { return 0; } - -#endif /* SLAPD_MONITOR */