summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdlib/abort.c
diff options
context:
space:
mode:
authortholo <tholo@openbsd.org>1996-10-25 03:09:15 +0000
committertholo <tholo@openbsd.org>1996-10-25 03:09:15 +0000
commit9565ac1a57c53383e1a5d21221fd467f327ffef0 (patch)
tree53b9e981e661d45f78c2edfbe7bd9da075f5adf4 /lib/libc/stdlib/abort.c
parentbump this too (diff)
downloadwireguard-openbsd-9565ac1a57c53383e1a5d21221fd467f327ffef0.tar.xz
wireguard-openbsd-9565ac1a57c53383e1a5d21221fd467f327ffef0.zip
POSIX requires stdio buffers be flushed on abort
Diffstat (limited to 'lib/libc/stdlib/abort.c')
-rw-r--r--lib/libc/stdlib/abort.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/libc/stdlib/abort.c b/lib/libc/stdlib/abort.c
index e8495753969..8f326d15dbe 100644
--- a/lib/libc/stdlib/abort.c
+++ b/lib/libc/stdlib/abort.c
@@ -32,7 +32,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: abort.c,v 1.2 1996/08/19 08:33:20 tholo Exp $";
+static char *rcsid = "$OpenBSD: abort.c,v 1.3 1996/10/25 03:09:15 tholo Exp $";
#endif /* LIBC_SCCS and not lint */
#include <signal.h>
@@ -44,6 +44,12 @@ 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