From dc824ef7363e46b3602b458f7bf00303601c1102 Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Wed, 15 May 2002 22:58:10 +0000 Subject: 2002-05-15 Jeff Johnston * libc/include/stdlib.h: Add on_exit prototype. * libc/include/sys/reent.h (struct _atexit): Add argument array and bits to track type of exit routine to support both on_exit and atexit. (_REENT_INIT_PTR): Add missing fields that won't be zeroed out by default and change the setting of the atexit structure. (_REENT_INIT)[!_REENT_SMALL]: Remove extraneous end brace. * libc/stdlib/on_exit.c: New file. * libc/stdlib/Makefile.am: Add support for on_exit. * libc/stdlib/Makefile.in: Regenerated. * libc/stdlib/atexit.c: Change to initialize types field. * libc/stdlib/exit.c: Change to look at types field for each exit routine and either call an atexit-style or an on_exit-style routine accordingly. --- newlib/libc/stdlib/atexit.c | 1 + 1 file changed, 1 insertion(+) (limited to 'newlib/libc/stdlib/atexit.c') diff --git a/newlib/libc/stdlib/atexit.c b/newlib/libc/stdlib/atexit.c index 77aab0c98..165b3cf07 100644 --- a/newlib/libc/stdlib/atexit.c +++ b/newlib/libc/stdlib/atexit.c @@ -74,6 +74,7 @@ _DEFUN (atexit, if ((p = (struct _atexit *) malloc (sizeof *p)) == NULL) return -1; p->_ind = 0; + p->_fntypes = 0; p->_next = _REENT->_atexit; _REENT->_atexit = p; } -- cgit v1.2.3