Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Brown <kbrown@cornell.edu>2022-07-05 01:32:10 +0300
committerKen Brown <kbrown@cornell.edu>2022-07-05 01:55:08 +0300
commit1503d14af1472824322d8fa8a012173b3f27a733 (patch)
treec762c67ede49c0aca4d650ca2149ffd36b416512 /newlib/libc/stdio
parent2c2c2b631bf2a11bfa335611077a774a98650afb (diff)
Cygwin: stdio: don't try again to read after EOF
This reverts commit 1f8f7e2d54, "* libc/stdio/refill.c (__srefill): Try again after EOF on Cygwin." If EOF is set on a file, the stdio input functions will now immediately return EOF rather than trying again to read. This aligns Cygwin's behavior to that of Linux. Addresses: https://cygwin.com/pipermail/cygwin/2022-June/251672.html
Diffstat (limited to 'newlib/libc/stdio')
-rw-r--r--newlib/libc/stdio/refill.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/newlib/libc/stdio/refill.c b/newlib/libc/stdio/refill.c
index 8516d8576..91e79e832 100644
--- a/newlib/libc/stdio/refill.c
+++ b/newlib/libc/stdio/refill.c
@@ -47,11 +47,9 @@ __srefill_r (struct _reent * ptr,
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)
@@ -115,13 +113,7 @@ __srefill_r (struct _reent * ptr,
fp->_p = fp->_bf._base;
fp->_r = fp->_read (ptr, fp->_cookie, (char *) fp->_p, fp->_bf._size);
-#ifndef __CYGWIN__
if (fp->_r <= 0)
-#else
- if (fp->_r > 0)
- fp->_flags &= ~__SEOF;
- else
-#endif
{
if (fp->_r == 0)
fp->_flags |= __SEOF;