diff options
author | 2010-05-12 15:05:39 +0000 | |
---|---|---|
committer | 2010-05-12 15:05:39 +0000 | |
commit | 2bebd0ecd967af4ec062a350a4f3ee4974f4bdb4 (patch) | |
tree | a7baf1b1c43edd5a2a1f458a2a4926fccd2149c6 /usr.bin/tmux/client.c | |
parent | port -ftrampolines/-Wtrampolines support from gcc3. (diff) | |
download | wireguard-openbsd-2bebd0ecd967af4ec062a350a4f3ee4974f4bdb4.tar.xz wireguard-openbsd-2bebd0ecd967af4ec062a350a4f3ee4974f4bdb4.zip |
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 'usr.bin/tmux/client.c')
-rw-r--r-- | usr.bin/tmux/client.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.bin/tmux/client.c b/usr.bin/tmux/client.c index 6586aab637e..3054b640789 100644 --- a/usr.bin/tmux/client.c +++ b/usr.bin/tmux/client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: client.c,v 1.38 2010/05/04 17:28:16 nicm Exp $ */ +/* $OpenBSD: client.c,v 1.39 2010/05/12 15:05:39 jsing Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -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; |