about summary refs log tree commit diff
path: root/event.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2018-12-04 15:56:10 -0500
committerJune McEnroe <june@causal.agency>2018-12-04 15:56:10 -0500
commit638be4e7757a7e7fcb52332461b5b1b5330a6771 (patch)
tree14190aec10060e1d8b9a3af6bc95b56781590cda /event.c
parentSend only SIGHUP in sandman (diff)
downloadcatgirl-638be4e7757a7e7fcb52332461b5b1b5330a6771.tar.gz
catgirl-638be4e7757a7e7fcb52332461b5b1b5330a6771.zip
Show error if disconnected unintentionally
Diffstat (limited to 'event.c')
-rw-r--r--event.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/event.c b/event.c
index 4ea9f81..a5a49cc 100644
--- a/event.c
+++ b/event.c
@@ -131,10 +131,14 @@ noreturn void eventLoop(void) {
 
 	for (;;) {
 		if (sig[SIGCHLD]) childWait();
-		if (sig[SIGHUP]) ircFmt("QUIT :zzz\r\n");
+		if (sig[SIGHUP]) {
+			ircFmt("QUIT :zzz\r\n");
+			self.quit = true;
+		}
 		if (sig[SIGINT]) {
 			signal(SIGINT, SIG_DFL);
 			ircFmt("QUIT :Goodbye\r\n");
+			self.quit = true;
 		}
 		if (sig[SIGWINCH]) {
 			curses.sa_handler(SIGWINCH);