summaryrefslogtreecommitdiffstats
path: root/libc/sysdeps/linux/common/ssp.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/linux/common/ssp.c')
-rw-r--r--libc/sysdeps/linux/common/ssp.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/libc/sysdeps/linux/common/ssp.c b/libc/sysdeps/linux/common/ssp.c
index 73d7113b8..8a84e4893 100644
--- a/libc/sysdeps/linux/common/ssp.c
+++ b/libc/sysdeps/linux/common/ssp.c
@@ -51,16 +51,15 @@ static void block_signals(void)
struct sigaction sa;
sigset_t mask;
- sigfillset(&mask);
-
- sigdelset(&mask, SSP_SIGTYPE); /* Block all signal handlers */
+ __sigfillset(&mask);
+ __sigdelset(&mask, SSP_SIGTYPE); /* Block all signal handlers */
sigprocmask(SIG_BLOCK, &mask, NULL); /* except SSP_SIGTYPE */
/* Make the default handler associated with the signal handler */
- memset(&sa, 0, sizeof(struct sigaction));
- sigfillset(&sa.sa_mask); /* Block all signals */
- sa.sa_flags = 0;
- sa.sa_handler = SIG_DFL;
+ memset(&sa, 0, sizeof(sa));
+ __sigfillset(&sa.sa_mask); /* Block all signals */
+ if (SIG_DFL) /* if it's constant zero, it's already done */
+ sa.sa_handler = SIG_DFL;
sigaction(SSP_SIGTYPE, &sa, NULL);
}