static struct main_hook hook;
static struct main_timer tm;
static struct main_signal sg;
+static int sig_counter;
static byte rb[16];
static int dhook(struct main_hook *ho UNUSED)
{
msg(L_INFO, "Hook called");
+ if (sig_counter >= 3)
+ return HOOK_SHUTDOWN;
return 0;
}
static void dsignal(struct main_signal *sg UNUSED)
{
- msg(L_INFO, "SIGINT received (use Ctrl-\\ to really quit)");
+ msg(L_INFO, "SIGINT received (send 3 times to really quit, or use Ctrl-\\)");
+ sig_counter++;
}
int
main_loop();
msg(L_INFO, "Finished.");
+
+ block_io_del(&fin);
+ block_io_del(&fout);
+ hook_del(&hook);
+ signal_del(&sg);
+ main_cleanup();
+ return 0;
}
#endif