Update of /cvsroot/tmux/tmux
In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv5019
Modified Files:
client.c signal.c
Log Message:
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@
Index: client.c
===================================================================
RCS file: /cvsroot/tmux/tmux/client.c,v
retrieving revision 1.91
retrieving revision 1.92
diff -u -d -r1.91 -r1.92
--- client.c 14 May 2010 14:30:00 -0000 1.91
+++ client.c 14 May 2010 14:35:26 -0000 1.92
@@ -210,6 +210,11 @@
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;
Index: signal.c
===================================================================
RCS file: /cvsroot/tmux/tmux/signal.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- signal.c 14 May 2010 14:30:01 -0000 1.1
+++ signal.c 14 May 2010 14:35:26 -0000 1.2
@@ -22,6 +22,7 @@
#include "tmux.h"
+struct event ev_sighup;
struct event ev_sigchld;
struct event ev_sigcont;
struct event ev_sigterm;
@@ -45,9 +46,9 @@
fatal("sigaction failed");
if (sigaction(SIGTSTP, &sigact, NULL) != 0)
fatal("sigaction failed");
- if (sigaction(SIGHUP, &sigact, NULL) != 0)
- fatal("sigaction failed");
+ signal_set(&ev_sighup, SIGHUP, handler, NULL);
+ signal_add(&ev_sighup, NULL);
signal_set(&ev_sigchld, SIGCHLD, handler, NULL);
signal_add(&ev_sigchld, NULL);
signal_set(&ev_sigcont, SIGCONT, handler, NULL);
@@ -77,9 +78,8 @@
fatal("sigaction failed");
if (sigaction(SIGTSTP, &sigact, NULL) != 0)
fatal("sigaction failed");
- if (sigaction(SIGHUP, &sigact, NULL) != 0)
- fatal("sigaction failed");
+ event_del(&ev_sighup);
event_del(&ev_sigchld);
event_del(&ev_sigcont);
event_del(&ev_sigterm);
------------------------------------------------------------------------------
_______________________________________________
tmux-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tmux-cvs