mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 10:51:54 -04:00
Intercept Ctrl-C at startup of all commands
This commit is contained in:
parent
fedeb99bdc
commit
5fd41d215b
3 changed files with 12 additions and 3 deletions
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue