diff --git a/servers/slapd/back-monitor/listener.c b/servers/slapd/back-monitor/listener.c index 20695a664e..707cd06631 100644 --- a/servers/slapd/back-monitor/listener.c +++ b/servers/slapd/back-monitor/listener.c @@ -39,6 +39,23 @@ monitor_subsys_listener_init( assert( be != NULL ); + if ( ( l = slapd_get_listeners() ) == NULL ) { + if ( slapMode & SLAP_TOOL_MODE ) { + return 0; + } + +#ifdef NEW_LOGGING + LDAP_LOG( OPERATION, CRIT, + "monitor_subsys_listener_init: " + "unable to get listeners\n", 0, 0, 0 ); +#else + Debug( LDAP_DEBUG_ANY, + "monitor_subsys_listener_init: " + "unable to get listeners\n", 0, 0, 0 ); +#endif + return( -1 ); + } + mi = ( struct monitorinfo * )be->be_private; if ( monitor_cache_get( mi, @@ -59,19 +76,6 @@ monitor_subsys_listener_init( return( -1 ); } - if ( ( l = slapd_get_listeners() ) == NULL ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, CRIT, - "monitor_subsys_listener_init: " - "unable to get listeners\n", 0, 0, 0 ); -#else - Debug( LDAP_DEBUG_ANY, - "monitor_subsys_listener_init: " - "unable to get listeners\n", 0, 0, 0 ); -#endif - return( -1 ); - } - e_tmp = NULL; for ( i = 0; l[i]; i++ ); for ( ; i--; ) {