summaryrefslogtreecommitdiff
path: root/libc/stdlib/abort.c
diff options
context:
space:
mode:
authorManuel Novoa III <mjn3@codepoet.org>2001-02-19 00:24:52 +0000
committerManuel Novoa III <mjn3@codepoet.org>2001-02-19 00:24:52 +0000
commitdfe2d42547de8197f850f3ff0dfdc3caa4682518 (patch)
tree0b2969dbdd6c65f1fb5832e25d28bffa9570084a /libc/stdlib/abort.c
parent438aac726283dfffa6a5cf84b4acf6df0250af94 (diff)
Create __uClibc_main to handle what can be done in C instead of each arch's
respective crt0.S. crt0.S should now only be responsible for setting things up to call __uClibc_main(argc, argv, envp), which will do any other necessary setup (setting global __environ, stdio init, etc), call main, and exit. This should ease both maintainance and porting.
Diffstat (limited to 'libc/stdlib/abort.c')
-rw-r--r--libc/stdlib/abort.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/libc/stdlib/abort.c b/libc/stdlib/abort.c
index 23510e913..7b7d6bb50 100644
--- a/libc/stdlib/abort.c
+++ b/libc/stdlib/abort.c
@@ -25,8 +25,8 @@ Cambridge, MA 02139, USA. */
#include <signal.h>
#include <errno.h>
-typedef void (*vfuncp) ();
-extern vfuncp __cleanup;
+typedef void (*vfuncp) (void);
+extern vfuncp __uClibc_cleanup;
extern void _exit __P((int __status)) __attribute__ ((__noreturn__));
/* Cause an abnormal program termination with core-dump. */
@@ -38,8 +38,9 @@ void abort(void)
sigprocmask(SIG_UNBLOCK, &sigset, (sigset_t *) NULL);
}
- if (__cleanup)
- __cleanup();
+ if (__uClibc_cleanup) { /* Not already executing __uClibc_cleanup. */
+ __uClibc_cleanup();
+ }
while (1)
if (raise(SIGABRT))