1
0
mirror of https://github.com/Tha14/toxic.git synced 2024-11-22 21:13:02 +01:00

double signal handler prevents accidental closes

This commit is contained in:
Daniel Hoffman 2017-05-19 13:36:43 -05:00
parent 09e2690211
commit acee4615f8

View File

@ -104,9 +104,16 @@ static struct user_password {
int len;
} user_password;
static time_t last_signal_time;
static void catch_SIGINT(int sig)
{
Winthread.sig_exit_toxic = 1;
time_t cur_time = get_unix_time();
if (difftime(cur_time, last_signal_time) <= 1) {
Winthread.sig_exit_toxic = 1;
} else {
last_signal_time = cur_time;
}
}
static void catch_SIGSEGV(int sig)