From: Andrey Rys Date: Sun, 28 Nov 2021 13:10:01 +0000 (+0100) Subject: always cap first print_crypt_status to less or equal 1 second. X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=1b12ee27233bd358a40406b5a7799230647c5ab1;p=tfcrypt.git always cap first print_crypt_status to less or equal 1 second. --- diff --git a/VERSION b/VERSION index ea90ee3..9e5feb5 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -45 +46 diff --git a/tfc_random.c b/tfc_random.c index 2ca459d..360b658 100644 --- a/tfc_random.c +++ b/tfc_random.c @@ -94,7 +94,7 @@ void gen_write_bytes(const char *foutname, tfc_fsize offset, tfc_fsize nrbytes) sigact.sa_handler = print_crypt_status; sigaction(SIGUSR1, &sigact, NULL); sigaction(SIGALRM, &sigact, NULL); - if (status_timer) setup_next_alarm(status_timer); + if (status_timer) setup_next_alarm(status_timer > 1000000 ? 1000000 : status_timer); sigact.sa_handler = change_status_width; sigaction(SIGQUIT, &sigact, NULL); sigact.sa_handler = change_status_timer; diff --git a/tfc_skein.c b/tfc_skein.c index 3f65669..8102f70 100644 --- a/tfc_skein.c +++ b/tfc_skein.c @@ -222,7 +222,7 @@ _dothat: continue; } - if (status_timer) setup_next_alarm(status_timer); + if (status_timer) setup_next_alarm(status_timer > 1000000 ? 1000000 : status_timer); if (skeinfd(hash, bits, mackey_opt ? mackey : NULL, fd, iseek, maxlen) != YES) { xerror(YES, NO, YES, "%s", fname); exitcode = 1; @@ -274,7 +274,7 @@ _dothat: continue; } -_dohash: if (status_timer) setup_next_alarm(status_timer); +_dohash: if (status_timer) setup_next_alarm(status_timer > 1000000 ? 1000000 : status_timer); if (skeinfd(hash, bits, mackey_opt ? mackey : NULL, fd, iseek, maxlen) != YES) { xerror(YES, NO, YES, "%s", fargv[x]); exitcode = 1; diff --git a/tfcrypt.c b/tfcrypt.c index b6bbe73..df7cc29 100644 --- a/tfcrypt.c +++ b/tfcrypt.c @@ -1089,7 +1089,7 @@ _plain: sigact.sa_handler = print_crypt_status; sigaction(SIGUSR1, &sigact, NULL); sigaction(SIGALRM, &sigact, NULL); - if (status_timer) setup_next_alarm(status_timer); + if (status_timer) setup_next_alarm(status_timer > 1000000 ? 1000000 : status_timer); sigact.sa_handler = change_status_width; sigaction(SIGQUIT, &sigact, NULL); sigact.sa_handler = change_status_timer;