Skip to content
Snippets Groups Projects
Commit 7cd64d38 authored by Howard Chu's avatar Howard Chu
Browse files

Use #ifdef SLAPD_MONITOR for monitor APIs

parent 9351c57c
No related branches found
No related tags found
No related merge requests found
......@@ -81,7 +81,11 @@ 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;
}
......@@ -425,11 +429,13 @@ 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;
......@@ -450,8 +456,10 @@ 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;
......@@ -675,6 +683,7 @@ bdb_back_initialize(
bi->bi_connection_init = 0;
bi->bi_connection_destroy = 0;
#ifdef SLAPD_MONITOR
/*
* initialize monitor stuff
*/
......@@ -682,6 +691,7 @@ bdb_back_initialize(
if ( rc ) {
return rc;
}
#endif
rc = bdb_back_init_cf( bi );
......
......@@ -16,6 +16,8 @@
#include "portable.h"
#ifdef SLAPD_MONITOR
#include <stdio.h>
#include <ac/string.h>
#include <ac/unistd.h>
......@@ -551,3 +553,4 @@ bdb_monitor_destroy( BackendDB *be )
return 0;
}
#endif /* SLAPD_MONITOR */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment