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/fflush.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/fflush.c')
-rw-r--r-- | lib/libc/stdio/fflush.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/lib/libc/stdio/fflush.c b/lib/libc/stdio/fflush.c index 55a6a2a..9ba2ec9 100644 --- a/lib/libc/stdio/fflush.c +++ b/lib/libc/stdio/fflush.c @@ -113,15 +113,9 @@ __sflush(FILE *fp) fp->_p = p; fp->_w = t & (__SLBF|__SNBF) ? 0 : fp->_bf._size; - if (n <= 0) - return (0); - if ((fp->_flags & __SAPP) && _sseek(fp, (fpos_t)0, SEEK_END) == -1) - goto err; - fp->_flags &= ~__SOFF; /* In case FAPPEND mode is set. */ for (; n > 0; n -= t, p += t) { - t = (*fp->_write)(fp->_cookie, (char *)p, n); + t = _swrite(fp, (char *)p, n); if (t <= 0) { - err: fp->_flags |= __SERR; return (EOF); } |