summaryrefslogtreecommitdiff
path: root/misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'misc.c')
-rw-r--r--misc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/misc.c b/misc.c
index 073d3be19..75fe4dfea 100644
--- a/misc.c
+++ b/misc.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: misc.c,v 1.146 2020/01/28 01:49:36 djm Exp $ */ 1/* $OpenBSD: misc.c,v 1.147 2020/04/25 06:59:36 dtucker Exp $ */
2/* 2/*
3 * Copyright (c) 2000 Markus Friedl. All rights reserved. 3 * Copyright (c) 2000 Markus Friedl. All rights reserved.
4 * Copyright (c) 2005,2006 Damien Miller. All rights reserved. 4 * Copyright (c) 2005,2006 Damien Miller. All rights reserved.
@@ -2303,11 +2303,13 @@ ssh_signal(int signum, sshsig_t handler)
2303 struct sigaction sa, osa; 2303 struct sigaction sa, osa;
2304 2304
2305 /* mask all other signals while in handler */ 2305 /* mask all other signals while in handler */
2306 bzero(&sa, sizeof(sa)); 2306 memset(&sa, 0, sizeof(sa));
2307 sa.sa_handler = handler; 2307 sa.sa_handler = handler;
2308 sigfillset(&sa.sa_mask); 2308 sigfillset(&sa.sa_mask);
2309#if defined(SA_RESTART) && !defined(NO_SA_RESTART)
2309 if (signum != SIGALRM) 2310 if (signum != SIGALRM)
2310 sa.sa_flags = SA_RESTART; 2311 sa.sa_flags = SA_RESTART;
2312#endif
2311 if (sigaction(signum, &sa, &osa) == -1) { 2313 if (sigaction(signum, &sa, &osa) == -1) {
2312 debug3("sigaction(%s): %s", strsignal(signum), strerror(errno)); 2314 debug3("sigaction(%s): %s", strsignal(signum), strerror(errno));
2313 return SIG_ERR; 2315 return SIG_ERR;