diff options
author | Curtis McEnroe | 2018-12-04 15:38:22 -0500 |
---|---|---|
committer | Curtis McEnroe | 2018-12-04 15:38:22 -0500 |
commit | b1427dd169fa27607a348cc6aae394c327ba562f (patch) | |
tree | 211744c2f4601705e0277d1d3c78810e47bc415b /event.c | |
parent | e01b03c96383b9e15fe1a2929c4d19869121d0a1 (diff) |
Send only SIGHUP in sandman
Diffstat (limited to 'event.c')
-rw-r--r-- | event.c | 4 |
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 }, |