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

Add test for sigwait returning EINTR.

parent 5da4ec06
No related branches found
No related tags found
No related merge requests found
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
***************************************************************************** *****************************************************************************
* Copyright (C) 2002 The Regents of the University of California. * Copyright (C) 2002 The Regents of the University of California.
* Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
* Written by Moe Jette <jette@llnl.gov>, Kevin Tew <tew1@llnl.gov>, et. al. * Written by Morris Jette <jette@llnl.gov>, Kevin Tew <tew1@llnl.gov>, et. al.
* UCRL-CODE-2002-040. * UCRL-CODE-2002-040.
* *
* This file is part of SLURM, a resource management program. * This file is part of SLURM, a resource management program.
...@@ -170,7 +170,7 @@ void run_backup(void) ...@@ -170,7 +170,7 @@ void run_backup(void)
* backup controller */ * backup controller */
static void *_background_signal_hand(void *no_data) static void *_background_signal_hand(void *no_data)
{ {
int sig, error_code; int sig, rc;
sigset_t set; sigset_t set;
/* Locks: Write configuration, job, node, and partition */ /* Locks: Write configuration, job, node, and partition */
slurmctld_lock_t config_write_lock = { slurmctld_lock_t config_write_lock = {
...@@ -188,7 +188,9 @@ static void *_background_signal_hand(void *no_data) ...@@ -188,7 +188,9 @@ static void *_background_signal_hand(void *no_data)
while (slurmctld_config.shutdown_time == 0) { while (slurmctld_config.shutdown_time == 0) {
xsignal_sigset_create(backup_sigarray, &set); xsignal_sigset_create(backup_sigarray, &set);
sigwait(&set, &sig); rc = sigwait(&set, &sig);
if (rc == EINTR)
continue;
switch (sig) { switch (sig) {
case SIGINT: /* kill -2 or <CTRL-C> */ case SIGINT: /* kill -2 or <CTRL-C> */
case SIGTERM: /* kill -15 */ case SIGTERM: /* kill -15 */
...@@ -205,10 +207,10 @@ static void *_background_signal_hand(void *no_data) ...@@ -205,10 +207,10 @@ static void *_background_signal_hand(void *no_data)
* restart the (possibly new) plugin. * restart the (possibly new) plugin.
*/ */
lock_slurmctld(config_write_lock); lock_slurmctld(config_write_lock);
error_code = read_slurm_conf(0); rc = read_slurm_conf(0);
if (error_code) if (rc)
error("read_slurm_conf: %s", error("read_slurm_conf: %s",
slurm_strerror(error_code)); slurm_strerror(rc));
else { else {
/* Leave config lock set through this */ /* Leave config lock set through this */
_update_cred_key(); _update_cred_key();
......
...@@ -371,7 +371,7 @@ static void _init_config(void) ...@@ -371,7 +371,7 @@ static void _init_config(void)
static void *_slurmctld_signal_hand(void *no_data) static void *_slurmctld_signal_hand(void *no_data)
{ {
int sig; int sig;
int error_code; int 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 */
...@@ -400,7 +400,9 @@ static void *_slurmctld_signal_hand(void *no_data) ...@@ -400,7 +400,9 @@ static void *_slurmctld_signal_hand(void *no_data)
while (1) { while (1) {
xsignal_sigset_create(sig_array, &set); xsignal_sigset_create(sig_array, &set);
sigwait(&set, &sig); rc = sigwait(&set, &sig);
if (rc == EINTR)
continue;
switch (sig) { switch (sig) {
case SIGINT: /* kill -2 or <CTRL-C> */ case SIGINT: /* kill -2 or <CTRL-C> */
case SIGTERM: /* kill -15 */ case SIGTERM: /* kill -15 */
...@@ -417,10 +419,10 @@ static void *_slurmctld_signal_hand(void *no_data) ...@@ -417,10 +419,10 @@ static void *_slurmctld_signal_hand(void *no_data)
* restart the (possibly new) plugin. * restart the (possibly new) plugin.
*/ */
lock_slurmctld(config_write_lock); lock_slurmctld(config_write_lock);
error_code = read_slurm_conf(0); rc = read_slurm_conf(0);
if (error_code) if (rc)
error("read_slurm_conf: %s", error("read_slurm_conf: %s",
slurm_strerror(error_code)); slurm_strerror(rc));
else { else {
_update_cred_key(); _update_cred_key();
set_slurmctld_state_loc(); set_slurmctld_state_loc();
......
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