]> git.sur5r.net Git - openldap/commitdiff
In sb_tls_bio_read/write, check for EAGAIN in addition to EWOULDBLOCK.
authorHoward Chu <hyc@openldap.org>
Fri, 11 Oct 2002 06:22:24 +0000 (06:22 +0000)
committerHoward Chu <hyc@openldap.org>
Fri, 11 Oct 2002 06:22:24 +0000 (06:22 +0000)
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

libraries/libldap/tls.c

index 68f7e09b59210ed8c56be0560cf983d9563169af..3af0ac761301a84fc1bf54fe5782738abc416581 100644 (file)
@@ -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;