aboutsummaryrefslogtreecommitdiff
path: root/newlib/libc/stdio/findfp.c
diff options
context:
space:
mode:
authorMatt Joyce <matthew.joyce@embedded-brains.de>2022-02-01 13:05:53 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2022-07-13 06:55:46 +0200
commite56801f34d798eafa054b383de5bf2df986576cc (patch)
tree9e9b119309ba424c7b198a07e2ca0e4febef95d8 /newlib/libc/stdio/findfp.c
parent3266a463274789de3d805667a851c08bf5b36c18 (diff)
downloadnewlib-e56801f34d798eafa054b383de5bf2df986576cc.zip
newlib-e56801f34d798eafa054b383de5bf2df986576cc.tar.gz
newlib-e56801f34d798eafa054b383de5bf2df986576cc.tar.bz2
Add _REENT_STDERR(ptr)
Add a _REENT_STDERR() macro to encapsulate access to the _stderr member of struct reent. This will help to replace the struct member with a thread-local storage object in a follow up patch.
Diffstat (limited to 'newlib/libc/stdio/findfp.c')
-rw-r--r--newlib/libc/stdio/findfp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/newlib/libc/stdio/findfp.c b/newlib/libc/stdio/findfp.c
index 04e3517..3c888d0 100644
--- a/newlib/libc/stdio/findfp.c
+++ b/newlib/libc/stdio/findfp.c
@@ -222,8 +222,8 @@ cleanup_stdio (struct _reent *ptr)
CLEANUP_FILE (ptr, _REENT_STDIN(ptr));
if (_REENT_STDOUT(ptr) != &__sf[1])
CLEANUP_FILE (ptr, _REENT_STDOUT(ptr));
- if (ptr->_stderr != &__sf[2])
- CLEANUP_FILE (ptr, ptr->_stderr);
+ if (_REENT_STDERR(ptr) != &__sf[2])
+ CLEANUP_FILE (ptr, _REENT_STDERR(ptr));
}
/*