]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-monitor/search.c
Simpler fix for NO_THREADS
[openldap] / servers / slapd / back-monitor / search.c
index cfc199e4fdd96e52cd430a13c2bd23291b06b345..800ada5dc0fd8473fc83d2c62f355543a6c53da1 100644 (file)
@@ -157,8 +157,8 @@ monitor_back_search(
        int             nentries = 0;
 
 #ifdef NEW_LOGGING
-       LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY,
-                  "monitor_back_search: enter\n" ));
+       LDAP_LOG( BACK_MON, ENTRY,
+                  "monitor_back_search: enter\n", 0, 0, 0 );
 #else
        Debug(LDAP_DEBUG_TRACE, "=> monitor_back_search\n%s%s%s", "", "", "");
 #endif
@@ -187,6 +187,7 @@ monitor_back_search(
                                        attrsonly, NULL );
                        nentries = 1;
                }
+               rc = LDAP_SUCCESS;
                monitor_cache_release( mi, e );
                break;
 
@@ -195,7 +196,7 @@ monitor_back_search(
                                attrs, attrsonly,
                                e, 0, &nentries );
                if ( rc ) {
-                       // error
+                       rc = LDAP_OTHER;
                }               
                
                break;
@@ -213,14 +214,14 @@ monitor_back_search(
                                attrs, attrsonly,
                                e, 1, &nentries );
                if ( rc ) {
-                       // error
+                       rc = LDAP_OTHER;
                }
 
                break;
        }
        
-       send_search_result( conn, op, LDAP_SUCCESS,
+       send_search_result( conn, op, rc,
                        NULL, NULL, NULL, NULL, nentries );
 
-       return( 0 );
+       return( rc == LDAP_SUCCESS ? 0 : 1 );
 }