Catch SIGHUP and terminate if running as a client. This prevents clients

from being left hanging around when, for example, a SSH session is
disconnected.

ok nicm@
This commit is contained in:
Joel Sing
2010-05-12 15:05:39 +00:00
parent e0f4697e7c
commit 72d1afa169
2 changed files with 9 additions and 4 deletions

View File

@ -206,6 +206,11 @@ client_signal(int sig, unused short events, unused void *data)
struct sigaction sigact;
switch (sig) {
case SIGHUP:
client_exitmsg = "lost tty";
client_exitval = 1;
client_write_server(MSG_EXITING, NULL, 0);
break;
case SIGTERM:
client_exitmsg = "terminated";
client_exitval = 1;