-O pid: show/log process id of running tfcrypt.
[tfcrypt.git] / tfc_random.c
index 2ca459d9e56a3330104b8f82e800d290db52cdc3..9f9105af68fdaf9a53beca93f24ff1e43882309d 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;
@@ -138,7 +138,7 @@ void gen_write_bytes(const char *foutname, tfc_fsize offset, tfc_fsize nrbytes)
        if (ctr_mode == TFC_MODE_PLAIN) memset(srcblk, 0, sizeof(srcblk));
 
        if (verbose) tfc_nfsay(stderr, "%s: writing %lld bytes to %s ... ",
-               progname, nrbytes, foutname);
+               tfc_format_pid(progname), nrbytes, foutname);
 
        errno = 0;
        do_stop = NO;