summaryrefslogtreecommitdiffstats
path: root/client.c
diff options
context:
space:
mode:
authorJoel Sing <jsing@openbsd.org>2010-05-12 15:05:39 +0000
committerJoel Sing <jsing@openbsd.org>2010-05-12 15:05:39 +0000
commit72d1afa169505710f3c8a05d4c6f6fc12257bfc7 (patch)
tree7b7e2fd21b42d32fce896524106697799cd9e196 /client.c
parente0f4697e7cfd1a09d6332eae607fd3a9a1181234 (diff)
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@
Diffstat (limited to 'client.c')
-rw-r--r--client.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/client.c b/client.c
index 5940f62e..092ae555 100644
--- a/client.c
+++ b/client.c
@@ -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;