void check_interrupt() { dlog("[D] In interrupt. Flag: %d\n",config.intr_flag); if (ISSET_INTERRUPT_END(config)) { game_over(); } else if (ISSET_INTERRUPT_SESSION(config)) { set_end_sessions(); } else if (ISSET_INTERRUPT_DNS(config)) { set_end_dns_records(); } else { config.intr_flag = 0; } }
void check_interupt() { if ( intr_flag == 1 ) { game_over(); } else if ( intr_flag == 2 ) { dump_active(); } else if ( intr_flag == 3 ) { set_end_sessions(); } else { intr_flag = 0; } }
void sig_alarm_handler() { time_t now_t; now_t = config.tstamp.tv_sec; dlog("[D] Got SIG ALRM: %lu\n", now_t); /* Each time check for timed out sessions */ set_end_sessions(); /* Only check for timed-out dns records each 10 minutes */ if ((now_t - config.dnslastchk) >= 600) { set_end_dns_records(); } alarm(TIMEOUT); }