From 7128f5a83e9ab67674ad082a875690e9349cc730 Mon Sep 17 00:00:00 2001 From: tholo <> Date: Fri, 25 Oct 1996 03:09:15 +0000 Subject: [PATCH] POSIX requires stdio buffers be flushed on abort --- src/lib/libc/stdlib/abort.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/lib/libc/stdlib/abort.c b/src/lib/libc/stdlib/abort.c index e8495753..8f326d15 100644 --- a/src/lib/libc/stdlib/abort.c +++ b/src/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 @@ -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