From b5adba895dff2ddce29d9447ec23af1307a58cb8 Mon Sep 17 00:00:00 2001 From: alex Date: Sat, 26 Oct 1996 01:42:33 +0000 Subject: POSIX requires stdio buffers be flushed on abort. Obtained from: OpenBSD, Thorsten Lockert --- lib/libc/stdlib/abort.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/libc/stdlib') 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 -- cgit v1.1