diff options
Diffstat (limited to 'lib/libc/stdlib/abort.c')
-rw-r--r-- | lib/libc/stdlib/abort.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/libc/stdlib/abort.c b/lib/libc/stdlib/abort.c index f415007..4fd34dc 100644 --- a/lib/libc/stdlib/abort.c +++ b/lib/libc/stdlib/abort.c @@ -44,11 +44,19 @@ static char sccsid[] = "@(#)abort.c 8.1 (Berkeley) 6/4/93"; #include "pthread_private.h" #endif +void (*__cleanup)(); + void abort() { sigset_t mask; + /* + * POSIX requires we flush stdio buffers on abort + */ + if (__cleanup) + (*__cleanup)(); + sigfillset(&mask); /* * don't block SIGABRT to give any handler a chance; we ignore |