diff --git a/cmdline/check.c b/cmdline/check.c index de2a318c..2ef8a9d6 100644 --- a/cmdline/check.c +++ b/cmdline/check.c @@ -2313,7 +2313,7 @@ static int state_check_process(struct snapraid_state* state, int fix, struct sna /* progress */ if (state_progress(state, 0, i, countpos, countmax, countsize)) { /* LCOV_EXCL_START */ - break; + goto end; /* LCOV_EXCL_STOP */ } @@ -2330,6 +2330,9 @@ static int state_check_process(struct snapraid_state* state, int fix, struct sna /* drop until now */ state_usage_waste(state); + + if (os_signal_interrupt()) + goto end; } } diff --git a/cmdline/dry.c b/cmdline/dry.c index c49c2265..7a33f317 100644 --- a/cmdline/dry.c +++ b/cmdline/dry.c @@ -352,6 +352,9 @@ static int state_dry_process(struct snapraid_state* state, struct snapraid_parit /* drop until now */ state_usage_waste(state); + + if (os_signal_interrupt()) + break; } } diff --git a/cmdline/scrub.c b/cmdline/scrub.c index 745b984d..aac2c096 100644 --- a/cmdline/scrub.c +++ b/cmdline/scrub.c @@ -931,6 +931,9 @@ static int state_scrub_process(struct snapraid_state* state, struct snapraid_par /* drop until now */ state_usage_waste(state); + + if (os_signal_interrupt()) + break; } /* autosave */ diff --git a/cmdline/sync.c b/cmdline/sync.c index 9f83e4b5..145405c2 100644 --- a/cmdline/sync.c +++ b/cmdline/sync.c @@ -1692,6 +1692,9 @@ static int state_sync_process(struct snapraid_state* state, struct snapraid_pari /* drop until now */ state_usage_waste(state); + + if (os_signal_interrupt()) + break; } /* autosave */ diff --git a/cmdline/thermal.c b/cmdline/thermal.c index fd5ca55b..7e138aec 100644 --- a/cmdline/thermal.c +++ b/cmdline/thermal.c @@ -354,7 +354,7 @@ void state_thermal_cooldown(struct snapraid_state* state) log_flush(); /* every 30 seconds spin down any disk that was spunup */ - while (sleep_time > 0) { + while (sleep_time > 0 && !os_signal_interrupt()) { state_device(state, DEVICE_DOWNIFUP, 0); sleep(30);