]> sourceware.org Git - newlib-cygwin.git/commitdiff
* libc/stdio/refill.c (__srefill): Try again after EOF on Cygwin. Clear EOF
authorChristopher Faylor <me@cgf.cx>
Wed, 17 Nov 2004 17:02:10 +0000 (17:02 +0000)
committerChristopher Faylor <me@cgf.cx>
Wed, 17 Nov 2004 17:02:10 +0000 (17:02 +0000)
flag if successful.

newlib/ChangeLog
newlib/libc/stdio/refill.c

index 9983e6ba6f8f5816dd4bcd50ccba203923aedcaa..8b8cf4d4c3d9af2e418e79f291bd331086f6878b 100644 (file)
@@ -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
index 74573e8fd478148bc65c340e4fc476f4555d5dcb..3f0b1a56603ae304ff84abad88eaf2f481a7e697 100644 (file)
@@ -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;
This page took 0.050401 seconds and 5 git commands to generate.