diff options
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libc/stdlib/abort.c | 8 |
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 | |||
| 39 | abort(void) | 39 | abort(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); |
