On 18/02/2020 01:25, chr...@rtems.org wrote:
From: Chris Johns <chr...@rtems.org>
- Newlib overtites any FILE pointers set in stdin, stdout or stderr.

Closes #3870
---
  cpukit/libcsupport/src/newlibc_reent.c | 5 ++++-
  1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/cpukit/libcsupport/src/newlibc_reent.c 
b/cpukit/libcsupport/src/newlibc_reent.c
index 430157cf0f..6dc0b1eeaa 100644
--- a/cpukit/libcsupport/src/newlibc_reent.c
+++ b/cpukit/libcsupport/src/newlibc_reent.c
@@ -44,7 +44,10 @@ bool newlib_create_hook(
    }
  #endif
- _REENT_INIT_PTR((creating_task->libc_reent)); /* GCC extension: structure constants */
+  extern void __sinit (struct _reent *s);
+  struct _reent *reent = (struct _reent *) creating_task->libc_reent;
+  _REENT_INIT_PTR((reent)); /* GCC extension: structure constants */
+  __sinit( reent );
return true;
  }
It would be good to test if this has the side-effect that now every 
thread delete closes the file descriptors 0, 1, and 2.
--
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.hu...@embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
_______________________________________________
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Reply via email to