diff options
author | Joel Sing <jsing@openbsd.org> | 2010-05-12 15:05:39 +0000 |
---|---|---|
committer | Joel Sing <jsing@openbsd.org> | 2010-05-12 15:05:39 +0000 |
commit | 72d1afa169505710f3c8a05d4c6f6fc12257bfc7 (patch) | |
tree | 7b7e2fd21b42d32fce896524106697799cd9e196 /client.c | |
parent | e0f4697e7cfd1a09d6332eae607fd3a9a1181234 (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.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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; |