aboutsummaryrefslogtreecommitdiff
path: root/newlib/libc/stdio/findfp.c
diff options
context:
space:
mode:
authorMatt Joyce <matthew.joyce@embedded-brains.de>2022-05-02 09:00:12 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2022-05-13 12:47:29 +0200
commit0a862d13193616811ce897e2bd50ca3003b47f84 (patch)
tree3dc9ac7c406d747d3aab58a7453373a2291d5dcc /newlib/libc/stdio/findfp.c
parent8b96542ed18990c9300daa4faba89ce8227b4482 (diff)
downloadnewlib-0a862d13193616811ce897e2bd50ca3003b47f84.zip
newlib-0a862d13193616811ce897e2bd50ca3003b47f84.tar.gz
newlib-0a862d13193616811ce897e2bd50ca3003b47f84.tar.bz2
Remove __sglue member for one configuration
Remove __sglue member of struct reent when _REENT_GLOBAL_STDIO_STREAMS is defined.
Diffstat (limited to 'newlib/libc/stdio/findfp.c')
-rw-r--r--newlib/libc/stdio/findfp.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/newlib/libc/stdio/findfp.c b/newlib/libc/stdio/findfp.c
index 29c068a..19952d4 100644
--- a/newlib/libc/stdio/findfp.c
+++ b/newlib/libc/stdio/findfp.c
@@ -242,8 +242,9 @@ cleanup_stdio (struct _reent *ptr)
CLEANUP_FILE (ptr, ptr->_stdout);
if (ptr->_stderr != &__sf[2])
CLEANUP_FILE (ptr, ptr->_stderr);
-#endif
+#else
(void) _fwalk_sglue (ptr, CLEANUP_FILE, &ptr->__sglue);
+#endif
}
/*
@@ -326,21 +327,27 @@ __fp_unlock (struct _reent * ptr __unused, FILE * fp)
void
__fp_lock_all (void)
{
+#ifndef _REENT_GLOBAL_STDIO_STREAMS
struct _reent *ptr;
+#endif
__sfp_lock_acquire ();
+#ifndef _REENT_GLOBAL_STDIO_STREAMS
ptr = _REENT;
(void) _fwalk_sglue (ptr, __fp_lock, &ptr->__sglue);
+#endif
}
void
__fp_unlock_all (void)
{
+#ifndef _REENT_GLOBAL_STDIO_STREAMS
struct _reent *ptr;
ptr = _REENT;
(void) _fwalk_sglue (ptr, __fp_unlock, &ptr->__sglue);
+#endif
__sfp_lock_release ();
}