Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Joyce <matthew.joyce@embedded-brains.de>2022-05-02 10:00:12 +0300
committerSebastian Huber <sebastian.huber@embedded-brains.de>2022-05-13 13:47:29 +0300
commit0a862d13193616811ce897e2bd50ca3003b47f84 (patch)
tree3dc9ac7c406d747d3aab58a7453373a2291d5dcc /newlib/libc/stdio
parent8b96542ed18990c9300daa4faba89ce8227b4482 (diff)
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')
-rw-r--r--newlib/libc/stdio/fcloseall.c5
-rw-r--r--newlib/libc/stdio/findfp.c9
2 files changed, 13 insertions, 1 deletions
diff --git a/newlib/libc/stdio/fcloseall.c b/newlib/libc/stdio/fcloseall.c
index f14c28d34..642dc7d94 100644
--- a/newlib/libc/stdio/fcloseall.c
+++ b/newlib/libc/stdio/fcloseall.c
@@ -59,7 +59,12 @@ Required OS subroutines: <<close>>, <<fstat>>, <<isatty>>, <<lseek>>,
int
_fcloseall_r (struct _reent *ptr)
{
+#ifdef _REENT_GLOBAL_STDIO_STREAMS
+ /* There are no thread-specific FILE objects */
+ return 0;
+#else
return _fwalk_sglue (ptr, _fclose_r, &ptr->__sglue);
+#endif
}
#ifndef _REENT_ONLY
diff --git a/newlib/libc/stdio/findfp.c b/newlib/libc/stdio/findfp.c
index 29c068a12..19952d4e0 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 ();
}