diff options
author | ache <ache@FreeBSD.org> | 2001-09-03 02:24:37 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 2001-09-03 02:24:37 +0000 |
commit | cbe865cf8c86d5f4b1c19485a2cd4ff56834b78f (patch) | |
tree | 1e9ab56239da83bdafac4d6f346eacc369bb761e /lib/libc/stdio/refill.c | |
parent | f1a12fefd65f6c3558da75f09d7892aa9f3cce9d (diff) | |
download | FreeBSD-src-cbe865cf8c86d5f4b1c19485a2cd4ff56834b78f.zip FreeBSD-src-cbe865cf8c86d5f4b1c19485a2cd4ff56834b78f.tar.gz |
Re-arrange my funopen(3) fix to minimize differences with original stdio code,
no functional changes.
Add fp->_offset optimization in _SAPP+_SOPT case
Diffstat (limited to 'lib/libc/stdio/refill.c')
-rw-r--r-- | lib/libc/stdio/refill.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/lib/libc/stdio/refill.c b/lib/libc/stdio/refill.c index 19d98f9..b3e292a 100644 --- a/lib/libc/stdio/refill.c +++ b/lib/libc/stdio/refill.c @@ -44,7 +44,6 @@ static const char rcsid[] = #include "namespace.h" #include <errno.h> -#include <limits.h> #include <stdio.h> #include <stdlib.h> #include "un-namespace.h" @@ -136,7 +135,7 @@ __srefill(FILE *fp) __sflush(fp); } fp->_p = fp->_bf._base; - fp->_r = (*fp->_read)(fp->_cookie, (char *)fp->_p, fp->_bf._size); + fp->_r = _sread(fp, (char *)fp->_p, fp->_bf._size); fp->_flags &= ~__SMOD; /* buffer contents are again pristine */ if (fp->_r <= 0) { if (fp->_r == 0) @@ -144,14 +143,8 @@ __srefill(FILE *fp) else { fp->_r = 0; fp->_flags |= __SERR; - fp->_flags &= ~__SOFF; } return (EOF); - } else if (fp->_flags & __SOFF) { - if (fp->_offset > OFF_MAX - fp->_r) - fp->_flags &= ~__SOFF; - else - fp->_offset += fp->_r; } return (0); } |