From 638be4e7757a7e7fcb52332461b5b1b5330a6771 Mon Sep 17 00:00:00 2001 From: Curtis McEnroe Date: Tue, 4 Dec 2018 15:56:10 -0500 Subject: Show error if disconnected unintentionally --- event.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'event.c') 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); -- cgit 1.4.1-2-gfad0