diff options
Diffstat (limited to 'newlib/libc/reent/reent.c')
-rw-r--r-- | newlib/libc/reent/reent.c | 38 |
1 files changed, 7 insertions, 31 deletions
diff --git a/newlib/libc/reent/reent.c b/newlib/libc/reent/reent.c index 63812db83..9f5a8c0d3 100644 --- a/newlib/libc/reent/reent.c +++ b/newlib/libc/reent/reent.c @@ -87,10 +87,14 @@ _DEFUN (_reclaim_reent, (ptr), _free_r (ptr, ptr->_localtime_buf); if (ptr->_asctime_buf) _free_r (ptr, ptr->_asctime_buf); +#endif + +#ifndef _REENT_GLOBAL_ATEXIT + /* atexit stuff */ +# ifdef _REENT_SMALL if (ptr->_atexit && ptr->_atexit->_on_exit_args_ptr) _free_r (ptr, ptr->_atexit->_on_exit_args_ptr); -#else - /* atexit stuff */ +# else if ((ptr->_atexit) && (ptr->_atexit != &ptr->_atexit0)) { struct _atexit *p, *q; @@ -101,6 +105,7 @@ _DEFUN (_reclaim_reent, (ptr), _free_r (ptr, q); } } +# endif #endif if (ptr->_cvtbuf) @@ -120,32 +125,3 @@ _DEFUN (_reclaim_reent, (ptr), } } - -/* - * Do atexit() processing and cleanup - * - * NOTE: This is to be executed at task exit. It does not tear anything - * down which is used on a global basis. - */ - -void -_DEFUN (_wrapup_reent, (ptr), struct _reent *ptr) -{ - register struct _atexit *p; - register int n; - - if (ptr == NULL) - ptr = _REENT; - -#ifdef _REENT_SMALL - for (p = ptr->_atexit, n = p ? p->_ind : 0; --n >= 0;) - (*p->_fns[n]) (); -#else - for (p = ptr->_atexit; p; p = p->_next) - for (n = p->_ind; --n >= 0;) - (*p->_fns[n]) (); -#endif - if (ptr->__cleanup) - (*ptr->__cleanup) (ptr); -} - |