Return with an error code if the there is a thermal alert that prevent starting
Some checks are pending
Build / build-mac (push) Waiting to run
Build / build-linux (push) Waiting to run
Build / build-win (push) Waiting to run
CodeQL Advanced / Analyze (c-cpp) (push) Waiting to run
CodeQL Advanced / Analyze (actions) (push) Waiting to run

This commit is contained in:
Andrea Mazzoleni 2026-02-09 23:49:02 +01:00
parent 03fb7d3cff
commit 5dfeaf0ef6
5 changed files with 65 additions and 27 deletions

View file

@ -343,8 +343,11 @@ static int state_scrub_process(struct snapraid_state* state, struct snapraid_par
/* start all the worker threads */
io_start(&io, blockstart, blockmax, block_enabled);
if (!state_progress_begin(state, blockstart, blockmax, countmax))
int alert = state_progress_begin(state, blockstart, blockmax, countmax);
if (alert > 0)
goto end;
if (alert < 0)
goto bail;
while (1) {
unsigned char* buffer_recov[LEV_MAX];
@ -762,6 +765,10 @@ bail:
if (soft_error + silent_error + io_error != 0)
return -1;
}
if (alert < 0)
return -1;
return 0;
}