From e39e6f77cf9dcad2fbf155f0e05110407d0e0cb5 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Wed, 9 Apr 1997 20:05:59 +0000 Subject: added code to prevent attempts to clean up the library when rtems is down. --- c/src/lib/libc/newlibc.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'c/src/lib/libc') diff --git a/c/src/lib/libc/newlibc.c b/c/src/lib/libc/newlibc.c index af3023fac2..cbf073cc13 100644 --- a/c/src/lib/libc/newlibc.c +++ b/c/src/lib/libc/newlibc.c @@ -79,6 +79,14 @@ extern void _reclaim_reent(struct _reent *); void libc_wrapup(void) { + /* + * In case RTEMS is already down, don't do this. It could be + * dangerous. + */ + + if (!_System_state_Is_up(_System_state_Get())) + return; + _wrapup_reent(0); if (_REENT != &libc_global_reent) { -- cgit v1.2.3