From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2210) id 8125E3858D1E; Mon, 4 Jul 2022 23:05:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8125E3858D1E Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Ken Brown To: cygwin-cvs@sourceware.org, newlib-cvs@sourceware.org Subject: [newlib-cygwin] Cygwin: stdio: don't try again to read after EOF X-Act-Checkin: newlib-cygwin X-Git-Author: Ken Brown X-Git-Refname: refs/heads/master X-Git-Oldrev: 2c2c2b631bf2a11bfa335611077a774a98650afb X-Git-Newrev: 1503d14af1472824322d8fa8a012173b3f27a733 Message-Id: <20220704230508.8125E3858D1E@sourceware.org> Date: Mon, 4 Jul 2022 23:05:08 +0000 (GMT) X-BeenThere: newlib-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib GIT logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jul 2022 23:05:08 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D1503d14af14= 72824322d8fa8a012173b3f27a733 commit 1503d14af1472824322d8fa8a012173b3f27a733 Author: Ken Brown Date: Mon Jul 4 18:32:10 2022 -0400 Cygwin: stdio: don't try again to read after EOF =20 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. =20 Addresses: https://cygwin.com/pipermail/cygwin/2022-June/251672.html Diff: --- newlib/libc/stdio/refill.c | 8 -------- winsup/cygwin/release/3.4.0 | 4 ++++ winsup/doc/new-features.xml | 4 ++++ 3 files changed, 8 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, =20 fp->_r =3D 0; /* largely a convenience for callers */ =20 -#ifndef __CYGWIN__ /* SysV does not make this test; take it out for compatibility */ if (fp->_flags & __SEOF) return EOF; -#endif =20 /* if not already reading, have to be reading and writing */ if ((fp->_flags & __SRD) =3D=3D 0) @@ -115,13 +113,7 @@ __srefill_r (struct _reent * ptr, =20 fp->_p =3D fp->_bf._base; fp->_r =3D fp->_read (ptr, fp->_cookie, (char *) fp->_p, fp->_bf._size); -#ifndef __CYGWIN__ if (fp->_r <=3D 0) -#else - if (fp->_r > 0) - fp->_flags &=3D ~__SEOF; - else -#endif { if (fp->_r =3D=3D 0) fp->_flags |=3D __SEOF; diff --git a/winsup/cygwin/release/3.4.0 b/winsup/cygwin/release/3.4.0 index a12905a46..ff600deca 100644 --- a/winsup/cygwin/release/3.4.0 +++ b/winsup/cygwin/release/3.4.0 @@ -17,6 +17,10 @@ What changed: opened in byte mode rather than message mode. Addresses: https://cygwin.com/pipermail/cygwin/2021-March/247987.html =20 +- The stdio input functions no longer try again to read after EOF. + This aligns Cygwin behavior to that of Linux. + Addresses: https://cygwin.com/pipermail/cygwin/2022-June/251672.html + =20 Bug Fixes --------- diff --git a/winsup/doc/new-features.xml b/winsup/doc/new-features.xml index c696a972a..0149a027a 100644 --- a/winsup/doc/new-features.xml +++ b/winsup/doc/new-features.xml @@ -29,6 +29,10 @@ opened in byte mode rather than message mode. Handle UDP_SEGMENT and UDP_GRO socket options. =20 + +The stdio input functions no longer try again to read after EOF. + + =20