sigact.sa_flags = SA_RESTART;
sigact.sa_handler = print_crypt_status;
sigaction(SIGUSR1, &sigact, NULL);
- sigaction(SIGTSTP, &sigact, NULL);
sigaction(SIGALRM, &sigact, NULL);
if (status_timer) setup_next_alarm(status_timer);
sigact.sa_handler = change_status_width;
sigact.sa_handler = print_crypt_status;
sigaction(SIGINT, &sigact, NULL);
sigaction(SIGTERM, &sigact, NULL);
+ sigaction(SIGTSTP, &sigact, NULL);
}
else {
sigact.sa_handler = exit_sigterm;
sigaction(SIGINT, &sigact, NULL);
sigaction(SIGTERM, &sigact, NULL);
+ sigact.sa_handler = handle_sigtstp;
+ sigaction(SIGTSTP, &sigact, NULL);
}
memset(&sigact, 0, sizeof(struct sigaction));
xexit(0);
}
+void handle_sigtstp(int signal)
+{
+ if (signal == SIGTSTP) kill(getpid(), SIGSTOP);
+}
+
void print_crypt_status(int signal)
{
tfc_fsize wr_speed;
delta_processed = 0;
tfc_getcurtime(&delta_time);
- if (signal == SIGTSTP) kill(getpid(), SIGSTOP);
+ handle_sigtstp(signal);
if (status_timer) setup_next_alarm(status_timer);
}
sigact.sa_flags = SA_RESTART;
sigact.sa_handler = print_crypt_status;
sigaction(SIGUSR1, &sigact, NULL);
- sigaction(SIGTSTP, &sigact, NULL);
sigaction(SIGALRM, &sigact, NULL);
sigact.sa_handler = change_status_width;
sigaction(SIGQUIT, &sigact, NULL);
sigact.sa_handler = exit_sigterm;
sigaction(SIGINT, &sigact, NULL);
sigaction(SIGTERM, &sigact, NULL);
+ sigact.sa_handler = handle_sigtstp;
+ sigaction(SIGTSTP, &sigact, NULL);
memset(&sigact, 0, sizeof(struct sigaction));
tfc_getcurtime(&delta_time);
sigact.sa_flags = SA_RESTART;
sigact.sa_handler = print_crypt_status;
sigaction(SIGUSR1, &sigact, NULL);
- sigaction(SIGTSTP, &sigact, NULL);
sigaction(SIGALRM, &sigact, NULL);
if (status_timer) setup_next_alarm(status_timer);
sigact.sa_handler = change_status_width;
sigact.sa_handler = print_crypt_status;
sigaction(SIGINT, &sigact, NULL);
sigaction(SIGTERM, &sigact, NULL);
+ sigaction(SIGTSTP, &sigact, NULL);
}
else {
sigact.sa_handler = exit_sigterm;
sigaction(SIGINT, &sigact, NULL);
sigaction(SIGTERM, &sigact, NULL);
+ sigact.sa_handler = handle_sigtstp;
+ sigaction(SIGTSTP, &sigact, NULL);
}
memset(&sigact, 0, sizeof(struct sigaction));
void tfc_finirandom(void);
void tfc_getrandom(void *buf, size_t sz);
void exit_sigterm(int signal);
+void handle_sigtstp(int signal);
void print_crypt_status(int signal);
void change_status_width(int signal);
void change_status_timer(int signal);