summaryrefslogtreecommitdiffstats
path: root/client.c
diff options
context:
space:
mode:
authorTiago Cunha <tcunha@gmx.com>2010-05-14 14:35:26 +0000
committerTiago Cunha <tcunha@gmx.com>2010-05-14 14:35:26 +0000
commit6694a018613fe2822e416a97b6433c2134e7723d (patch)
tree7150db141bc765f4f3c1e4084927d8f5b198e933 /client.c
parent9900e28ba88526eec3ba623ea1ebc94116257c97 (diff)
Sync OpenBSD patchset 698:
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.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/client.c b/client.c
index 8aa4e845..14248761 100644
--- a/client.c
+++ b/client.c
@@ -1,4 +1,4 @@
-/* $Id: client.c,v 1.91 2010-05-14 14:30:00 tcunha Exp $ */
+/* $Id: client.c,v 1.92 2010-05-14 14:35:26 tcunha Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -210,6 +210,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;