summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdlib/abort.c
diff options
context:
space:
mode:
authortedu <tedu@openbsd.org>2014-05-14 21:54:20 +0000
committertedu <tedu@openbsd.org>2014-05-14 21:54:20 +0000
commitc833d94866232a4a304f54e7cb8f024e0a80c671 (patch)
treec424858bd63708455201464c68f5c57947c707bf /lib/libc/stdlib/abort.c
parentimprove style - basically, what my fingers did at Marrakesh airport when (diff)
downloadwireguard-openbsd-c833d94866232a4a304f54e7cb8f024e0a80c671.tar.xz
wireguard-openbsd-c833d94866232a4a304f54e7cb8f024e0a80c671.zip
stop flushing streams in abort(). it's hackish and unsafe, and no longer
required. try to document this fact and some of the history. with feedback from deraadt guenther millert
Diffstat (limited to 'lib/libc/stdlib/abort.c')
-rw-r--r--lib/libc/stdlib/abort.c19
1 files changed, 1 insertions, 18 deletions
diff --git a/lib/libc/stdlib/abort.c b/lib/libc/stdlib/abort.c
index 4c8dc70a1d5..dd057710ff2 100644
--- a/lib/libc/stdlib/abort.c
+++ b/lib/libc/stdlib/abort.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: abort.c,v 1.16 2012/11/10 03:46:11 guenther Exp $ */
+/* $OpenBSD: abort.c,v 1.17 2014/05/14 21:54:20 tedu Exp $ */
/*
* Copyright (c) 1985 Regents of the University of California.
* All rights reserved.
@@ -39,8 +39,6 @@ int _thread_sys_sigprocmask(int, const sigset_t *, sigset_t *);
void
abort(void)
{
- struct atexit *p = __atexit;
- static int cleanup_called = 0;
sigset_t mask;
@@ -52,21 +50,6 @@ abort(void)
sigdelset(&mask, SIGABRT);
(void)_thread_sys_sigprocmask(SIG_SETMASK, &mask, (sigset_t *)NULL);
- /*
- * POSIX requires we flush stdio buffers on abort
- */
- if (cleanup_called == 0) {
- /* the cleanup routine lives in fns[0] on the last page */
- while (p != NULL && p->next != NULL)
- p = p->next;
- /* the check for fn_dso == NULL is mostly paranoia */
- if (p != NULL && p->fns[0].fn_dso == NULL &&
- p->fns[0].fn_ptr.std_func != NULL) {
- cleanup_called = 1;
- (*p->fns[0].fn_ptr.std_func)();
- }
- }
-
(void)raise(SIGABRT);
/*