summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorguenther <>2015-10-25 04:13:59 +0000
committerguenther <>2015-10-25 04:13:59 +0000
commit0212631215a7430ecb20d586035f725f42d0cde4 (patch)
treef441acc74e810fe5a60fddee932acae1c8cf8f58 /src/lib
parentbf8064e5addf51d4c3571881db1e37bffdab9267 (diff)
downloadopenbsd-0212631215a7430ecb20d586035f725f42d0cde4.tar.gz
openbsd-0212631215a7430ecb20d586035f725f42d0cde4.tar.bz2
openbsd-0212631215a7430ecb20d586035f725f42d0cde4.zip
Use sigaction() instead of signal() to avoid pulling in unnecessary
wrappers. To keep uses from crawling back in, mark signal() as deprecated inside libc. ok deraadt@
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libc/stdlib/abort.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/libc/stdlib/abort.c b/src/lib/libc/stdlib/abort.c
index 710cd7da47..129a1735f3 100644
--- a/src/lib/libc/stdlib/abort.c
+++ b/src/lib/libc/stdlib/abort.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: abort.c,v 1.19 2015/10/23 04:39:24 guenther Exp $ */ 1/* $OpenBSD: abort.c,v 1.20 2015/10/25 04:13:59 guenther Exp $ */
2/* 2/*
3 * Copyright (c) 1985 Regents of the University of California. 3 * Copyright (c) 1985 Regents of the University of California.
4 * All rights reserved. 4 * All rights reserved.
@@ -39,7 +39,7 @@ void
39abort(void) 39abort(void)
40{ 40{
41 sigset_t mask; 41 sigset_t mask;
42 42 struct sigaction sa;
43 43
44 sigfillset(&mask); 44 sigfillset(&mask);
45 /* 45 /*
@@ -55,7 +55,9 @@ abort(void)
55 * if SIGABRT ignored, or caught and the handler returns, do 55 * if SIGABRT ignored, or caught and the handler returns, do
56 * it again, only harder. 56 * it again, only harder.
57 */ 57 */
58 (void)signal(SIGABRT, SIG_DFL); 58 memset(&sa, 0, sizeof(sa));
59 sa.sa_handler = SIG_DFL;
60 (void)sigaction(SIGABRT, &sa, NULL);
59 (void)sigprocmask(SIG_SETMASK, &mask, NULL); 61 (void)sigprocmask(SIG_SETMASK, &mask, NULL);
60 (void)raise(SIGABRT); 62 (void)raise(SIGABRT);
61 _exit(1); 63 _exit(1);