summaryrefslogtreecommitdiff
path: root/rts/posix
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2020-04-13 11:43:15 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-04-22 23:13:43 -0400
commit6f84aca31290afc11acde0f86969a535e519e1d5 (patch)
tree141e7d9af21cb132a47ff50f05bfa25e38f5dc2e /rts/posix
parentffde234854f49dba9ec4735aad74b30fd2deee29 (diff)
downloadhaskell-6f84aca31290afc11acde0f86969a535e519e1d5.tar.gz
rts: Ensure that sigaction structs are initialized
I noticed these may have uninitialized fields when looking into #18037. The reporter says that zeroing them doesn't fix the MSAN failures they observe but zeroing them is the right thing to do regardless.
Diffstat (limited to 'rts/posix')
-rw-r--r--rts/posix/Signals.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/rts/posix/Signals.c b/rts/posix/Signals.c
index f8bd9fb829..2e534042f3 100644
--- a/rts/posix/Signals.c
+++ b/rts/posix/Signals.c
@@ -624,7 +624,7 @@ set_sigtstp_action (bool handle)
void
install_vtalrm_handler(int sig, TickProc handle_tick)
{
- struct sigaction action;
+ struct sigaction action = {};
action.sa_handler = handle_tick;
@@ -666,7 +666,8 @@ install_vtalrm_handler(int sig, TickProc handle_tick)
void
initDefaultHandlers(void)
{
- struct sigaction action,oact;
+ struct sigaction action = {};
+ struct sigaction oact = {};
// install the SIGINT handler
action.sa_handler = shutdown_handler;