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;
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;