Skip to content
Snippets Groups Projects
Commit 46c9bcd6 authored by Ben Gamari's avatar Ben Gamari Committed by Marge Bot
Browse files

rts: Don't rely on initializers for sigaction_t

As noted in #23577, CentOS's ancient toolchain throws spurious
missing-field-initializer warnings.
parent 2be99b7e
No related branches found
No related tags found
No related merge requests found
......@@ -368,9 +368,11 @@ int
stg_sig_install(int sig, int spi, void *mask)
{
sigset_t signals, osignals;
struct sigaction action;
StgInt previous_spi;
struct sigaction action;
memset(&action, 0, sizeof(struct sigaction));
ACQUIRE_LOCK(&sig_mutex);
// Block the signal until we figure out what to do
......@@ -619,6 +621,7 @@ static void
set_sigtstp_action (bool handle)
{
struct sigaction sa;
memset(&sa, 0, sizeof(struct sigaction));
if (handle) {
sa.sa_handler = sigtstp_handler;
} else {
......@@ -635,7 +638,8 @@ set_sigtstp_action (bool handle)
void
install_vtalrm_handler(int sig, TickProc handle_tick)
{
struct sigaction action = {};
struct sigaction action;
memset(&action, 0, sizeof(struct sigaction));
action.sa_handler = handle_tick;
......@@ -677,8 +681,11 @@ install_vtalrm_handler(int sig, TickProc handle_tick)
void
initDefaultHandlers(void)
{
struct sigaction action = {};
struct sigaction oact = {};
// N.B. We can't use initializers here as CentOS's ancient toolchain throws
// spurious warnings. See #23577.
struct sigaction action, oact;
memset(&oact, 0, sizeof(struct sigaction));
memset(&action, 0, sizeof(struct sigaction));
// install the SIGINT handler
action.sa_handler = shutdown_handler;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment