diff options
author | Christopher Faylor <me@cgf.cx> | 2004-11-17 17:02:10 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2004-11-17 17:02:10 +0000 |
commit | 1f8f7e2d54364bd2993892adffb5c6435f53167d (patch) | |
tree | 9108d37b5d229330424d105b1d162f6a151b6212 /newlib | |
parent | cd1ab47e384368a0ec5904601cb552ab85689ab6 (diff) | |
download | newlib-1f8f7e2d54364bd2993892adffb5c6435f53167d.zip newlib-1f8f7e2d54364bd2993892adffb5c6435f53167d.tar.gz newlib-1f8f7e2d54364bd2993892adffb5c6435f53167d.tar.bz2 |
* libc/stdio/refill.c (__srefill): Try again after EOF on Cygwin. Clear EOF
flag if successful.
Diffstat (limited to 'newlib')
-rw-r--r-- | newlib/ChangeLog | 5 | ||||
-rw-r--r-- | newlib/libc/stdio/refill.c | 8 |
2 files changed, 13 insertions, 0 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog index 9983e6b..8b8cf4d 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,8 @@ +2004-11-17 Christopher Faylor <cgf@timesys.com> + + * libc/stdio/refill.c (__srefill): Try again after EOF on Cygwin. Clear + EOF flag if successful. + 2004-10-28 Christopher Faylor <cgf@timesys.com> * libc/include/sys/signal.h: Move <signal.h> include to bottom of file diff --git a/newlib/libc/stdio/refill.c b/newlib/libc/stdio/refill.c index 74573e8..3f0b1a5 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; |