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