summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdlib/abort.c
diff options
context:
space:
mode:
authormarc <marc@openbsd.org>2002-11-03 20:36:43 +0000
committermarc <marc@openbsd.org>2002-11-03 20:36:43 +0000
commit7d696152b04eda612deebda7dd931656647baf68 (patch)
treec8d6614acef79d09c5a8c85d3b59a6535a731ded /lib/libc/stdlib/abort.c
parentYou can't always cast pointer to int on because the sizes are (diff)
downloadwireguard-openbsd-7d696152b04eda612deebda7dd931656647baf68.tar.xz
wireguard-openbsd-7d696152b04eda612deebda7dd931656647baf68.zip
libc changes for thread safety. Tested on:
alpha (millert@), i386 (marc@), m68k (millert@ and miod@), powerpc (drahn@ and dhartmei@), sparc (millert@ and marc@), sparc64 (marc@), and vax (millert@ and miod@). Thanks to millert@, miod@, and mickey@ for fixes along the way.
Diffstat (limited to 'lib/libc/stdlib/abort.c')
-rw-r--r--lib/libc/stdlib/abort.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/lib/libc/stdlib/abort.c b/lib/libc/stdlib/abort.c
index 7057f9b1ad0..6fffe3df7c2 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.8 2002/09/14 22:03:14 dhartmei Exp $";
+static char *rcsid = "$OpenBSD: abort.c,v 1.9 2002/11/03 20:36:43 marc Exp $";
#endif /* LIBC_SCCS and not lint */
#include <signal.h>
@@ -55,11 +55,7 @@ abort()
* any errors -- X311J doesn't allow abort to return anyway.
*/
sigdelset(&mask, SIGABRT);
-#ifdef _THREAD_SAFE
(void)_thread_sys_sigprocmask(SIG_SETMASK, &mask, (sigset_t *)NULL);
-#else /* _THREAD_SAFE */
- (void)sigprocmask(SIG_SETMASK, &mask, (sigset_t *)NULL);
-#endif /* _THREAD_SAFE */
/*
* POSIX requires we flush stdio buffers on abort
@@ -80,11 +76,7 @@ abort()
* it again, only harder.
*/
(void)signal(SIGABRT, SIG_DFL);
-#ifdef _THREAD_SAFE
(void)_thread_sys_sigprocmask(SIG_SETMASK, &mask, (sigset_t *)NULL);
-#else /* _THREAD_SAFE */
- (void)sigprocmask(SIG_SETMASK, &mask, (sigset_t *)NULL);
-#endif /* _THREAD_SAFE */
(void)kill(getpid(), SIGABRT);
exit(1);
}