]> git.sur5r.net Git - openldap/commitdiff
fix ITS#3254
authorPierangelo Masarati <ando@openldap.org>
Sun, 25 Jul 2004 22:57:52 +0000 (22:57 +0000)
committerPierangelo Masarati <ando@openldap.org>
Sun, 25 Jul 2004 22:57:52 +0000 (22:57 +0000)
servers/slapd/back-monitor/listener.c

index 20695a664e8b9a8b814fee590f002ffe5c3720a1..707cd0663146d855e76b3f4bf6407d3ce214ff57 100644 (file)
@@ -39,35 +39,39 @@ monitor_subsys_listener_init(
 
        assert( be != NULL );
 
-       mi = ( struct monitorinfo * )be->be_private;
+       if ( ( l = slapd_get_listeners() ) == NULL ) {
+               if ( slapMode & SLAP_TOOL_MODE ) {
+                       return 0;
+               }
 
-       if ( monitor_cache_get( mi, 
-                               &monitor_subsys[SLAPD_MONITOR_LISTENER].mss_ndn, 
-                               &e_listener ) ) {
 #ifdef NEW_LOGGING
                LDAP_LOG( OPERATION, CRIT,
                        "monitor_subsys_listener_init: "
-                       "unable to get entry '%s'\n",
-                       monitor_subsys[SLAPD_MONITOR_LISTENER].mss_ndn.bv_val, 0, 0 );
+                       "unable to get listeners\n", 0, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "monitor_subsys_listener_init: "
-                       "unable to get entry '%s'\n%s%s",
-                       monitor_subsys[SLAPD_MONITOR_LISTENER].mss_ndn.bv_val, 
-                       "", "" );
+                       "unable to get listeners\n", 0, 0, 0 );
 #endif
                return( -1 );
        }
 
-       if ( ( l = slapd_get_listeners() ) == NULL ) {
+       mi = ( struct monitorinfo * )be->be_private;
+
+       if ( monitor_cache_get( mi, 
+                               &monitor_subsys[SLAPD_MONITOR_LISTENER].mss_ndn, 
+                               &e_listener ) ) {
 #ifdef NEW_LOGGING
                LDAP_LOG( OPERATION, CRIT,
                        "monitor_subsys_listener_init: "
-                       "unable to get listeners\n", 0, 0, 0 );
+                       "unable to get entry '%s'\n",
+                       monitor_subsys[SLAPD_MONITOR_LISTENER].mss_ndn.bv_val, 0, 0 );
 #else
                Debug( LDAP_DEBUG_ANY,
                        "monitor_subsys_listener_init: "
-                       "unable to get listeners\n", 0, 0, 0 );
+                       "unable to get entry '%s'\n%s%s",
+                       monitor_subsys[SLAPD_MONITOR_LISTENER].mss_ndn.bv_val, 
+                       "", "" );
 #endif
                return( -1 );
        }