summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdio/fflush.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/stdio/fflush.c')
-rw-r--r--lib/libc/stdio/fflush.c8
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);
}
OpenPOWER on IntegriCloud