mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-16 21:29:59 +01:00
Fix batch mode for tools progress function.
This commit is contained in:
@@ -137,7 +137,6 @@ static int wipe_callback(uint64_t size, uint64_t offset, void *usrptr)
|
||||
static struct timeval start_time = {}, end_time = {};
|
||||
int r = 0;
|
||||
|
||||
if (!opt_batch_mode)
|
||||
tools_time_progress(size, offset, &start_time, &end_time);
|
||||
|
||||
check_signal(&r);
|
||||
|
||||
@@ -351,6 +351,9 @@ void tools_time_progress(uint64_t device_size, uint64_t bytes,
|
||||
double tdiff, mib;
|
||||
int final = (bytes == device_size);
|
||||
|
||||
if (opt_batch_mode)
|
||||
return;
|
||||
|
||||
gettimeofday(&now_time, NULL);
|
||||
if (start_time->tv_sec == 0 && start_time->tv_usec == 0) {
|
||||
*start_time = now_time;
|
||||
|
||||
Reference in New Issue
Block a user