diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2022-05-18 13:26:13 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2022-06-10 20:13:52 +0200 |
commit | c4d4439c4208b75454edef0b42d5585de8ac9f47 (patch) | |
tree | e3fb554bb5330c3039372a443c5145bbbea50683 | |
parent | aa460cc0ca4a028c6544f88e4e187ef8ec3c6684 (diff) | |
download | newlib-c4d4439c4208b75454edef0b42d5585de8ac9f47.zip newlib-c4d4439c4208b75454edef0b42d5585de8ac9f47.tar.gz newlib-c4d4439c4208b75454edef0b42d5585de8ac9f47.tar.bz2 |
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.
-rw-r--r-- | newlib/libc/stdio/findfp.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/newlib/libc/stdio/findfp.c b/newlib/libc/stdio/findfp.c index ff6804d..858c09e 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 = _REENT; (void) _fwalk_sglue (ptr, __fp_lock, &ptr->__sglue); +#else + (void) _fwalk_sglue (NULL, __fp_lock, &__sglue); #endif } @@ -340,6 +342,8 @@ __fp_unlock_all (void) ptr = _REENT; (void) _fwalk_sglue (ptr, __fp_unlock, &ptr->__sglue); +#else + (void) _fwalk_sglue (NULL, __fp_unlock, &__sglue); #endif __sfp_lock_release (); |