X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=tfc_random.c;h=d3f2ee303ff09bcd8a9dfe6d93dc19518fb451be;hb=e16562d4f4180c1364181c92d6d8f285f322f12c;hp=2ca459d9e56a3330104b8f82e800d290db52cdc3;hpb=10fd1044fc86d4537fdc6b05320f5a3d3996727d;p=tfcrypt.git diff --git a/tfc_random.c b/tfc_random.c index 2ca459d..d3f2ee3 100644 --- a/tfc_random.c +++ b/tfc_random.c @@ -88,13 +88,15 @@ void gen_write_bytes(const char *foutname, tfc_fsize offset, tfc_fsize nrbytes) size_t lblock, lio, lrem; tfc_byte *pblk; + xexit_no_nl = YES; + for (x = 1; x < NSIG; x++) signal(x, SIG_IGN); memset(&sigact, 0, sizeof(sigact)); sigact.sa_flags = SA_RESTART; 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 +140,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; @@ -180,6 +182,7 @@ _wagain: lio = xwrite(fd, pblk, lrem); if (verbose) tfc_esay("done!"); if (verbose || status_timer) print_crypt_status(0); + if (verbose) tfc_esay("\n"); xclose(fd); xexit(0);