From b1427dd169fa27607a348cc6aae394c327ba562f Mon Sep 17 00:00:00 2001 From: Curtis McEnroe Date: Tue, 4 Dec 2018 15:38:22 -0500 Subject: Send only SIGHUP in sandman --- event.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'event.c') diff --git a/event.c b/event.c index 444e7df..4ea9f81 100644 --- a/event.c +++ b/event.c @@ -120,6 +120,7 @@ noreturn void eventLoop(void) { }; sigaction(SIGCHLD, &action, NULL); sigaction(SIGINT, &action, NULL); + sigaction(SIGHUP, &action, NULL); struct sigaction curses; sigaction(SIGWINCH, &action, &curses); @@ -130,6 +131,7 @@ noreturn void eventLoop(void) { for (;;) { if (sig[SIGCHLD]) childWait(); + if (sig[SIGHUP]) ircFmt("QUIT :zzz\r\n"); if (sig[SIGINT]) { signal(SIGINT, SIG_DFL); ircFmt("QUIT :Goodbye\r\n"); @@ -139,7 +141,7 @@ noreturn void eventLoop(void) { uiRead(); uiDraw(); } - sig[SIGCHLD] = sig[SIGINT] = sig[SIGWINCH] = 0; + sig[SIGCHLD] = sig[SIGHUP] = sig[SIGINT] = sig[SIGWINCH] = 0; struct pollfd fds[3] = { { .events = POLLIN, .fd = irc }, -- cgit 1.4.0