mirror of
https://github.com/amadvance/snapraid.git
synced 2026-11-22 16:06:30 -05:00
Return with an error code if the there is a thermal alert that prevent starting
This commit is contained in:
parent
03fb7d3cff
commit
5dfeaf0ef6
5 changed files with 65 additions and 27 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue