diff options
author | alex <alex@FreeBSD.org> | 1996-10-26 01:42:33 +0000 |
---|---|---|
committer | alex <alex@FreeBSD.org> | 1996-10-26 01:42:33 +0000 |
commit | b5adba895dff2ddce29d9447ec23af1307a58cb8 (patch) | |
tree | 2dbebe3e7367d349210b9cb1c42d648176ab3b45 /lib | |
parent | a5f434cb1c23e7128ef71fb63d55716d7a370e5a (diff) | |
download | FreeBSD-src-b5adba895dff2ddce29d9447ec23af1307a58cb8.zip FreeBSD-src-b5adba895dff2ddce29d9447ec23af1307a58cb8.tar.gz |
POSIX requires stdio buffers be flushed on abort.
Obtained from: OpenBSD, Thorsten Lockert <tholo@OpenBSD.ORG>
Diffstat (limited to 'lib')
-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 |