Skip to content
Snippets Groups Projects
Commit 095889d3 authored by Moe Jette's avatar Moe Jette
Browse files

convert repeated logic into a single loop

parent 5d9904a3
No related branches found
No related tags found
No related merge requests found
...@@ -785,7 +785,7 @@ static int _reconfigure_slurm(void) ...@@ -785,7 +785,7 @@ static int _reconfigure_slurm(void)
static void *_slurmctld_signal_hand(void *no_data) static void *_slurmctld_signal_hand(void *no_data)
{ {
int sig; int sig;
int rc; int i, rc;
int sig_array[] = {SIGINT, SIGTERM, SIGHUP, SIGABRT, 0}; int sig_array[] = {SIGINT, SIGTERM, SIGHUP, SIGABRT, 0};
sigset_t set; sigset_t set;
/* Locks: Read configuration */ /* Locks: Read configuration */
...@@ -804,11 +804,8 @@ static void *_slurmctld_signal_hand(void *no_data) ...@@ -804,11 +804,8 @@ static void *_slurmctld_signal_hand(void *no_data)
unlock_slurmctld(config_read_lock); unlock_slurmctld(config_read_lock);
/* Make sure no required signals are ignored (possibly inherited) */ /* Make sure no required signals are ignored (possibly inherited) */
_default_sigaction(SIGINT); for (i = 0; sig_array[i]; i++)
_default_sigaction(SIGTERM); _default_sigaction(sig_array[i]);
_default_sigaction(SIGHUP);
_default_sigaction(SIGABRT);
while (1) { while (1) {
xsignal_sigset_create(sig_array, &set); xsignal_sigset_create(sig_array, &set);
rc = sigwait(&set, &sig); rc = sigwait(&set, &sig);
......
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