From: Howard Chu Date: Mon, 19 May 2003 10:37:09 +0000 (+0000) Subject: ITS#2490 - more retry checks X-Git-Tag: OPENLDAP_REL_ENG_2_2_0ALPHA~110 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=5eb0ec070c8d43011b860591c6caba8d84e79331;p=openldap ITS#2490 - more retry checks --- diff --git a/libraries/liblber/dtest.c b/libraries/liblber/dtest.c index 387bf6dcc1..32ea47713d 100644 --- a/libraries/liblber/dtest.c +++ b/libraries/liblber/dtest.c @@ -24,6 +24,7 @@ #include #include #include +#include #ifdef HAVE_CONSOLE_H #include @@ -73,10 +74,14 @@ main( int argc, char **argv ) return( EXIT_FAILURE ); } - tag = ber_get_next( sb, &len, ber); - if( tag == LBER_ERROR ) { - perror( "ber_get_next" ); - return( EXIT_FAILURE ); + for (;;) { + tag = ber_get_next( sb, &len, ber); + if( tag == LBER_ERROR ) { + if( errno == EWOULDBLOCK ) continue; + if( errno == EAGAIN ) continue; + perror( "ber_get_next" ); + return( EXIT_FAILURE ); + } } printf("decode: message tag 0x%lx and length %ld\n", diff --git a/libraries/liblber/io.c b/libraries/liblber/io.c index bab1fbe91c..9428e1f602 100644 --- a/libraries/liblber/io.c +++ b/libraries/liblber/io.c @@ -540,6 +540,11 @@ ber_get_next( } /* Did we run out of bytes? */ if ((char *)p == ber->ber_rwptr) { +#if defined( EWOULDBLOCK ) + errno = EWOULDBLOCK; +#elif defined( EAGAIN ) + errno = EAGAIN; +#endif return LBER_DEFAULT; } }