-#ifndef LDAP_REFERRALS
- /* hack attack */
- if ( ld->ld_sb.sb_ber.ber_ptr >= ld->ld_sb.sb_ber.ber_end ) {
- rc = ldap_select1( ld, tvp );
-
-#if !defined( MACOS ) && !defined( DOS )
- if ( rc == 0 || ( rc == -1 && (( ld->ld_options &
- LDAP_OPT_RESTART ) == 0 || errno != EINTR ))) {
-#else
- if ( rc == -1 || rc == 0 ) {
-#endif
- ld->ld_errno = (rc == -1 ? LDAP_SERVER_DOWN :
- LDAP_TIMEOUT);
- return( rc );
- }
-
- }
- if ( rc == -1 ) {
- rc = -2; /* select interrupted: loop */
- } else {
- rc = read1msg( ld, msgid, all, &ld->ld_sb, result );
- }
-#else /* !LDAP_REFERRALS */