Intercept Ctrl-C at startup of all commands
Some checks failed
Build / build-mac (push) Has been cancelled
Build / build-linux (push) Has been cancelled
Build / build-win (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled

This commit is contained in:
Andrea Mazzoleni 2025-09-24 11:32:10 +02:00
parent fedeb99bdc
commit 5fd41d215b
3 changed files with 12 additions and 3 deletions

View file

@ -942,7 +942,9 @@ static int state_check_process(struct snapraid_state* state, int fix, struct sna
/* check all the blocks in files */
countsize = 0;
countpos = 0;
state_progress_begin(state, blockstart, blockmax, countmax);
if (!state_progress_begin(state, blockstart, blockmax, countmax))
goto end;
for (i = blockstart; i < blockmax; ++i) {
unsigned failed_count;
int valid_parity;
@ -1816,6 +1818,7 @@ static int state_check_process(struct snapraid_state* state, int fix, struct sna
}
}
end:
state_progress_end(state, countpos, countmax, countsize);
bail:

View file

@ -199,7 +199,9 @@ static int state_dry_process(struct snapraid_state* state, struct snapraid_parit
/* start all the worker threads */
io_start(&io, blockstart, blockmax, 0);
state_progress_begin(state, blockstart, blockmax, countmax);
if (!state_progress_begin(state, blockstart, blockmax, countmax))
goto end;
while (1) {
void** buffer;
@ -345,6 +347,7 @@ static int state_dry_process(struct snapraid_state* state, struct snapraid_parit
}
}
end:
state_progress_end(state, countpos, countmax, countsize);
state_usage_print(state);

View file

@ -320,7 +320,9 @@ static int state_scrub_process(struct snapraid_state* state, struct snapraid_par
/* start all the worker threads */
io_start(&io, blockstart, blockmax, block_enabled);
state_progress_begin(state, blockstart, blockmax, countmax);
if (!state_progress_begin(state, blockstart, blockmax, countmax))
goto end;
while (1) {
unsigned char* buffer_recov[LEV_MAX];
snapraid_info info;
@ -647,6 +649,7 @@ static int state_scrub_process(struct snapraid_state* state, struct snapraid_par
}
}
end:
state_progress_end(state, countpos, countmax, countsize);
state_usage_print(state);