From: Howard Chu Date: Fri, 11 Oct 2002 06:22:24 +0000 (+0000) Subject: In sb_tls_bio_read/write, check for EAGAIN in addition to EWOULDBLOCK. X-Git-Tag: NO_SLAP_OP_BLOCKS~891 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=a9fed89e3f22a944dbcd2d3d2aabaf1e75f83617;p=openldap In sb_tls_bio_read/write, check for EAGAIN in addition to EWOULDBLOCK. According to read(2)/write(2) EAGAIN is the only one we're interested in. Fixes HP-UX 11. http://www.openldap.org/lists/openldap-software/200105/msg00564.html --- diff --git a/libraries/libldap/tls.c b/libraries/libldap/tls.c index 68f7e09b59..3af0ac7613 100644 --- a/libraries/libldap/tls.c +++ b/libraries/libldap/tls.c @@ -645,8 +645,11 @@ sb_tls_bio_read( BIO *b, char *buf, int len ) ret = LBER_SBIOD_READ_NEXT( p->sbiod, buf, len ); BIO_clear_retry_flags( b ); - if ( ret < 0 && errno == EWOULDBLOCK ) { - BIO_set_retry_read( b ); + if ( ret < 0 ) { + int err = errno; + if ( err == EAGAIN || err == EWOULDBLOCK ) { + BIO_set_retry_read( b ); + } } return ret; @@ -669,8 +672,11 @@ sb_tls_bio_write( BIO *b, const char *buf, int len ) ret = LBER_SBIOD_WRITE_NEXT( p->sbiod, (char *)buf, len ); BIO_clear_retry_flags( b ); - if ( ret < 0 && errno == EWOULDBLOCK ) { - BIO_set_retry_write( b ); + if ( ret < 0 ) { + int err = errno; + if ( err == EAGAIN || err == EWOULDBLOCK ) { + BIO_set_retry_write( b ); + } } return ret;