- if ( tvp == NULL && rc == 0 ) {
- ldap_get_option( ld, LDAP_OPT_RESULT_CODE, (void *)&rc );
- }
-
- switch ( rc ) {
- case LDAP_SUCCESS:
- case LDAP_REFERRAL:
- break;
-
- default:
- 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 );