public inbox for
help / color / mirror / Atom feed
From: Sebastian Huber <>
Subject: [newlib-cygwin] Fix __fp_lock_all() and __fp_unlock_all()
Date: Fri, 10 Jun 2022 18:45:18 +0000 (GMT)	[thread overview]
Message-ID: <> (raw);h=c4d4439c4208b75454edef0b42d5585de8ac9f47

commit c4d4439c4208b75454edef0b42d5585de8ac9f47
Author: Sebastian Huber <>
Date:   Wed May 18 13:26:13 2022 +0200

    Fix __fp_lock_all() and __fp_unlock_all()
    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 no FILE
    object at all was locked.

 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)
   ptr = _REENT;
   (void) _fwalk_sglue (ptr, __fp_lock, &ptr->__sglue);
+  (void) _fwalk_sglue (NULL, __fp_lock, &__sglue);
@@ -340,6 +342,8 @@ __fp_unlock_all (void)
   ptr = _REENT;
   (void) _fwalk_sglue (ptr, __fp_unlock, &ptr->__sglue);
+  (void) _fwalk_sglue (NULL, __fp_unlock, &__sglue);
   __sfp_lock_release ();

                 reply	other threads:[~2022-06-10 18:45 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).