X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;ds=sidebyside;f=tfc_signal.c;h=b0d6e482f1bb7fabb82ae0f5df6b7bad60848fe0;hb=e48de7c114fc724a6c1e45fd8716dc6111d01372;hp=b2862eedcdaa53fab7f6c71b13b691dd3ff6563a;hpb=10fd1044fc86d4537fdc6b05320f5a3d3996727d;p=tfcrypt.git diff --git a/tfc_signal.c b/tfc_signal.c index b2862ee..b0d6e48 100644 --- a/tfc_signal.c +++ b/tfc_signal.c @@ -35,7 +35,14 @@ void exit_sigterm(int signal) void handle_sigtstp(int signal) { - if (signal == SIGTSTP) kill(getpid(), SIGSTOP); + if (signal == SIGTSTP) { + tfc_useconds freeze_start, freeze_end; + + tfc_getcurtime(&freeze_start); + kill(getpid(), SIGSTOP); + tfc_getcurtime(&freeze_end); + total_time -= (freeze_end - freeze_start); + } } void print_crypt_status(int signal) @@ -79,8 +86,7 @@ void print_crypt_status(int signal) "avg. speed %llu (%.2f%s) B/s, time %.4fs.", oper_mode, total_processed_src, human_totalproc_src, tfc_getscale(src_scale_idx), - wr_speed, human_wr_speed, tfc_getscale(wr_speed_scale), - TFC_UTODSECS(current_time - delta_time)); + wr_speed, human_wr_speed, tfc_getscale(wr_speed_scale), seconds); tfc_esay("\n"); xexit(0); } @@ -89,28 +95,28 @@ void print_crypt_status(int signal) else inplace = ""; if (do_less_stats == YES) { - tfc_nfsay(stderr, "%s%s:" + tfc_nfsay(stderr, "%s%s%s:" " %s %.2f%s," " %.2f%s B/s @%s", - inplace, progname, + inplace, (last && show_when_done) ? "finished: " : "", progname, oper_mode, human_totalproc_dst, tfc_getscale(dst_scale_idx), human_wr_speed, tfc_getscale(wr_speed_scale), tfc_format_time(total_time)); } else { - if (ctr_mode <= TFC_MODE_PLAIN) tfc_nfsay(stderr, "%s%s: read: %llu (%.2f%s)," + if (ctr_mode <= TFC_MODE_PLAIN) tfc_nfsay(stderr, "%s%s%s: read: %llu (%.2f%s)," " %s %llu (%.2f%s) bytes," " (%llu (%.2f%s) B/s), time %s", - inplace, progname, + inplace, (last && show_when_done) ? "finished: " : "", progname, total_processed_src, human_totalproc_src, tfc_getscale(src_scale_idx), oper_mode, total_processed_dst, human_totalproc_dst, tfc_getscale(dst_scale_idx), wr_speed, human_wr_speed, tfc_getscale(wr_speed_scale), tfc_format_time(total_time)); - else tfc_nfsay(stderr, "%s%s: read: %llu (%.2f%s)," + else tfc_nfsay(stderr, "%s%s%s: read: %llu (%.2f%s)," " %s %s %llu (%.2f%s) bytes," " written %llu (%.2f%s) bytes," " (%llu (%.2f%s) B/s), time %s", - inplace, progname, + inplace, (last && show_when_done) ? "finished: " : "", progname, total_processed_src, human_totalproc_src, tfc_getscale(src_scale_idx), tfc_modename(ctr_mode), oper_mode, total_processed_dst, human_totalproc_dst, tfc_getscale(dst_scale_idx),