diff options
Diffstat (limited to 'newlib/libc/stdio/refill.c')
-rw-r--r-- | newlib/libc/stdio/refill.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/newlib/libc/stdio/refill.c b/newlib/libc/stdio/refill.c index 74573e8fd..3f0b1a566 100644 --- a/newlib/libc/stdio/refill.c +++ b/newlib/libc/stdio/refill.c @@ -45,9 +45,11 @@ _DEFUN(__srefill, (fp), fp->_r = 0; /* largely a convenience for callers */ +#ifndef __CYGWIN__ /* SysV does not make this test; take it out for compatibility */ if (fp->_flags & __SEOF) return EOF; +#endif /* if not already reading, have to be reading and writing */ if ((fp->_flags & __SRD) == 0) @@ -98,7 +100,13 @@ _DEFUN(__srefill, (fp), fp->_p = fp->_bf._base; fp->_r = (*fp->_read) (fp->_cookie, (char *) fp->_p, fp->_bf._size); fp->_flags &= ~__SMOD; /* buffer contents are again pristine */ +#ifndef __CYGWIN__ if (fp->_r <= 0) +#else + if (fp->_r > 0) + fp->_flags &= ~__SEOF; + else +#endif { if (fp->_r == 0) fp->_flags |= __SEOF; |