summaryrefslogtreecommitdiff
path: root/src/lib/libc/stdlib/abort.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libc/stdlib/abort.c')
-rw-r--r--src/lib/libc/stdlib/abort.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/lib/libc/stdlib/abort.c b/src/lib/libc/stdlib/abort.c
index 072a9fa8c1..244e3b28aa 100644
--- a/src/lib/libc/stdlib/abort.c
+++ b/src/lib/libc/stdlib/abort.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: abort.c,v 1.14 2005/08/08 08:05:36 espie Exp $ */ 1/* $OpenBSD: abort.c,v 1.15 2007/09/03 14:40:16 millert Exp $ */
2/* 2/*
3 * Copyright (c) 1985 Regents of the University of California. 3 * Copyright (c) 1985 Regents of the University of California.
4 * All rights reserved. 4 * All rights reserved.
@@ -54,11 +54,14 @@ abort(void)
54 * POSIX requires we flush stdio buffers on abort 54 * POSIX requires we flush stdio buffers on abort
55 */ 55 */
56 if (cleanup_called == 0) { 56 if (cleanup_called == 0) {
57 /* the cleanup routine lives in fns[0] on the last page */
57 while (p != NULL && p->next != NULL) 58 while (p != NULL && p->next != NULL)
58 p = p->next; 59 p = p->next;
59 if (p != NULL && p->fns[0] != NULL) { 60 /* the check for fn_dso == NULL is mostly paranoia */
61 if (p != NULL && p->fns[0].fn_dso == NULL &&
62 p->fns[0].fn_ptr.std_func != NULL) {
60 cleanup_called = 1; 63 cleanup_called = 1;
61 (*p->fns[0])(); 64 (*p->fns[0].fn_ptr.std_func)();
62 } 65 }
63 } 66 }
64 67