always cap first print_crypt_status to less or equal 1 second.
authorAndrey Rys <rys@lynxlynx.ru>
Sun, 28 Nov 2021 13:10:01 +0000 (14:10 +0100)
committerAndrey Rys <rys@lynxlynx.ru>
Sun, 28 Nov 2021 13:10:01 +0000 (14:10 +0100)
VERSION
tfc_random.c
tfc_skein.c
tfcrypt.c

diff --git a/VERSION b/VERSION
index ea90ee31980757b2e469741512bcb39e73494e78..9e5feb5256930f3cae636754eef8a244ede164eb 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-45
+46
index 2ca459d9e56a3330104b8f82e800d290db52cdc3..360b6584e8c2e0ed273235b519aa89d9b6f2e1ad 100644 (file)
@@ -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;
index 3f656696a01a9029bf2f18419feda61b058ab5d6..8102f70af122cff0cbeb7055150ea83267238494 100644 (file)
@@ -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;
index b6bbe73de3cd3f3d38497fe2c8e11cd2697af735..df7cc29f130d485b3e11ff0007615171a573e7f4 100644 (file)
--- 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;