From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1921) id F39B13858016; Fri, 10 Jun 2022 18:45:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F39B13858016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Sebastian Huber To: newlib-cvs@sourceware.org Subject: [newlib-cygwin] Fix __fp_lock_all() and __fp_unlock_all() X-Act-Checkin: newlib-cygwin X-Git-Author: Sebastian Huber X-Git-Refname: refs/heads/master X-Git-Oldrev: aa460cc0ca4a028c6544f88e4e187ef8ec3c6684 X-Git-Newrev: c4d4439c4208b75454edef0b42d5585de8ac9f47 Message-Id: <20220610184518.F39B13858016@sourceware.org> Date: Fri, 10 Jun 2022 18:45:18 +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: Fri, 10 Jun 2022 18:45:19 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3Dc4d4439c420= 8b75454edef0b42d5585de8ac9f47 commit c4d4439c4208b75454edef0b42d5585de8ac9f47 Author: Sebastian Huber Date: Wed May 18 13:26:13 2022 +0200 Fix __fp_lock_all() and __fp_unlock_all() =20 For _REENT_GLOBAL_STDIO_STREAMS, lock/unlock all FILE objects. In the repository, this function is only used by Cygwin during process forks. = Since Cygwin enabled _REENT_GLOBAL_STDIO_STREAMS recently, without this fix n= o FILE object at all was locked. Diff: --- newlib/libc/stdio/findfp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/newlib/libc/stdio/findfp.c b/newlib/libc/stdio/findfp.c index ff6804d19..858c09ee3 100644 --- a/newlib/libc/stdio/findfp.c +++ b/newlib/libc/stdio/findfp.c @@ -329,6 +329,8 @@ __fp_lock_all (void) #ifndef _REENT_GLOBAL_STDIO_STREAMS ptr =3D _REENT; (void) _fwalk_sglue (ptr, __fp_lock, &ptr->__sglue); +#else + (void) _fwalk_sglue (NULL, __fp_lock, &__sglue); #endif } =20 @@ -340,6 +342,8 @@ __fp_unlock_all (void) =20 ptr =3D _REENT; (void) _fwalk_sglue (ptr, __fp_unlock, &ptr->__sglue); +#else + (void) _fwalk_sglue (NULL, __fp_unlock, &__sglue); #endif =20 __sfp_lock_release ();