From 9757665aed90c0d2bb4cbc2941a5456b8bbdb773 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Mon, 19 May 2003 10:33:18 +0000 Subject: [PATCH] ITS#2490 - allow retry for incomplete reads of BER tag & len --- libraries/liblber/io.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/libraries/liblber/io.c b/libraries/liblber/io.c index 921363177b..bab1fbe91c 100644 --- a/libraries/liblber/io.c +++ b/libraries/liblber/io.c @@ -543,10 +543,10 @@ ber_get_next( return LBER_DEFAULT; } } + if (sblen == 1) continue; + ber->ber_tag = tag; ber->ber_ptr = (char *)p; - - if (sblen == 1) continue; } /* Now look for the length */ @@ -559,6 +559,11 @@ ber_get_next( } /* Not enough bytes? */ if (ber->ber_rwptr - ber->ber_ptr < llen) { +#if defined( EWOULDBLOCK ) + errno = EWOULDBLOCK; +#elif defined( EAGAIN ) + errno = EAGAIN; +#endif return LBER_DEFAULT; } for (i=0; -- 2.39.5