mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-01-02 04:59:39 -05:00
Protect errno values from Debug
This commit is contained in:
parent
731aad4c4d
commit
27fc008761
1 changed files with 10 additions and 7 deletions
|
|
@ -351,18 +351,20 @@ wait4msg(
|
|||
#endif
|
||||
|
||||
if ( !lc_ready ) {
|
||||
int err;
|
||||
rc = ldap_int_select( ld, tvp );
|
||||
#ifdef LDAP_DEBUG
|
||||
if ( rc == -1 ) {
|
||||
err = sock_errno();
|
||||
#ifdef LDAP_DEBUG
|
||||
Debug( LDAP_DEBUG_TRACE,
|
||||
"ldap_int_select returned -1: errno %d\n",
|
||||
sock_errno(), 0, 0 );
|
||||
}
|
||||
err, 0, 0 );
|
||||
#endif
|
||||
}
|
||||
|
||||
if ( rc == 0 || ( rc == -1 && (
|
||||
!LDAP_BOOL_GET(&ld->ld_options, LDAP_BOOL_RESTART)
|
||||
|| sock_errno() != EINTR ) ) )
|
||||
|| err != EINTR ) ) )
|
||||
{
|
||||
ld->ld_errno = (rc == -1 ? LDAP_SERVER_DOWN :
|
||||
LDAP_TIMEOUT);
|
||||
|
|
@ -493,7 +495,7 @@ try_read1msg(
|
|||
LDAPRequest *lr, *tmplr, dummy_lr = { 0 };
|
||||
LDAPConn *lc;
|
||||
BerElement tmpber;
|
||||
int rc, refer_cnt, hadref, simple_request;
|
||||
int rc, refer_cnt, hadref, simple_request, err;
|
||||
ber_int_t lderr;
|
||||
|
||||
#ifdef LDAP_CONNECTIONLESS
|
||||
|
|
@ -547,15 +549,16 @@ nextresp3:
|
|||
break;
|
||||
|
||||
case LBER_DEFAULT:
|
||||
err = sock_errno();
|
||||
#ifdef LDAP_DEBUG
|
||||
Debug( LDAP_DEBUG_CONNS,
|
||||
"ber_get_next failed.\n", 0, 0, 0 );
|
||||
#endif
|
||||
#ifdef EWOULDBLOCK
|
||||
if ( sock_errno() == EWOULDBLOCK ) return LDAP_MSG_X_KEEP_LOOKING;
|
||||
if ( err == EWOULDBLOCK ) return LDAP_MSG_X_KEEP_LOOKING;
|
||||
#endif
|
||||
#ifdef EAGAIN
|
||||
if ( sock_errno() == EAGAIN ) return LDAP_MSG_X_KEEP_LOOKING;
|
||||
if ( err == EAGAIN ) return LDAP_MSG_X_KEEP_LOOKING;
|
||||
#endif
|
||||
ld->ld_errno = LDAP_SERVER_DOWN;
|
||||
#ifdef LDAP_R_COMPILE
|
||||
|
|
|
|||
Loading…
Reference in a new issue