- if ( tvp == NULL && rc == 0 ) {
- ldap_get_option( ld, LDAP_OPT_RESULT_CODE, (void *)&rc );
- }
-
- if ( rc != 0 ) {
- tool_perror( "ldap_result", rc, NULL, NULL, NULL, NULL );
- return( rc );
+ if ( tvp == NULL && rc != LDAP_RES_SEARCH_RESULT ) {
+ ldap_get_option( ld, LDAP_OPT_RESULT_CODE, (void *)&rc2 );