diff --git a/lib/libc/xdr/xdr_rec.c b/lib/libc/xdr/xdr_rec.c index a50d1414ad4a..34238ed01321 100644 --- a/lib/libc/xdr/xdr_rec.c +++ b/lib/libc/xdr/xdr_rec.c @@ -574,6 +574,12 @@ __xdrrec_getrec(xdrs, statp, expectdata) rstrm->in_header &= ~LAST_FRAG; rstrm->last_frag = TRUE; } + /* + * We can only reasonably expect to read once from a + * non-blocking stream. Reading the fragment header + * may have drained the stream. + */ + expectdata = FALSE; } n = rstrm->readit(rstrm->tcp_handle,