summary refs log tree commit diff
path: root/event.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2018-12-04 15:38:22 -0500
committerJune McEnroe <june@causal.agency>2018-12-04 15:38:22 -0500
commitb1427dd169fa27607a348cc6aae394c327ba562f (patch)
tree211744c2f4601705e0277d1d3c78810e47bc415b /event.c
parentRevert half-working reconnecting stuff (diff)
downloadcatgirl-b1427dd169fa27607a348cc6aae394c327ba562f.tar.gz
catgirl-b1427dd169fa27607a348cc6aae394c327ba562f.zip
Send only SIGHUP in sandman
Diffstat (limited to '')
-rw-r--r--event.c4
1 files changed, 3 insertions, 1 deletions
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 },