aboutsummaryrefslogtreecommitdiff
path: root/tmux.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2009-05-16 10:02:51 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2009-05-16 10:02:51 +0000
commit03af7c99b58d65cd9ec0a95e02658c152e18f41e (patch)
tree9027df02bbdf4d2c6556acaef4479b15dbd60c15 /tmux.c
parent92de1ad6c833ec8253e07be2a10689b7f5f2c9a6 (diff)
downloadrtmux-03af7c99b58d65cd9ec0a95e02658c152e18f41e.tar.gz
rtmux-03af7c99b58d65cd9ec0a95e02658c152e18f41e.tar.bz2
rtmux-03af7c99b58d65cd9ec0a95e02658c152e18f41e.zip
Recreate server socket on SIGUSR1, per SF feature request 2792533.
Diffstat (limited to 'tmux.c')
-rw-r--r--tmux.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/tmux.c b/tmux.c
index ca9d1caa..e93b96b5 100644
--- a/tmux.c
+++ b/tmux.c
@@ -1,4 +1,4 @@
-/* $Id: tmux.c,v 1.116 2009-05-13 23:27:00 nicm Exp $ */
+/* $Id: tmux.c,v 1.117 2009-05-16 10:02:51 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -47,6 +47,8 @@ volatile sig_atomic_t sigwinch;
volatile sig_atomic_t sigterm;
volatile sig_atomic_t sigcont;
volatile sig_atomic_t sigchld;
+volatile sig_atomic_t sigusr1;
+volatile sig_atomic_t sigusr2;
char *cfg_file;
struct options global_options;
@@ -110,6 +112,12 @@ sighandler(int sig)
case SIGCONT:
sigcont = 1;
break;
+ case SIGUSR1:
+ sigusr1 = 1;
+ break;
+ case SIGUSR2:
+ sigusr2 = 1;
+ break;
}
errno = saved_errno;
}
@@ -126,10 +134,6 @@ siginit(void)
act.sa_handler = SIG_IGN;
if (sigaction(SIGPIPE, &act, NULL) != 0)
fatal("sigaction failed");
- if (sigaction(SIGUSR1, &act, NULL) != 0)
- fatal("sigaction failed");
- if (sigaction(SIGUSR2, &act, NULL) != 0)
- fatal("sigaction failed");
if (sigaction(SIGINT, &act, NULL) != 0)
fatal("sigaction failed");
if (sigaction(SIGTSTP, &act, NULL) != 0)
@@ -144,6 +148,10 @@ siginit(void)
fatal("sigaction failed");
if (sigaction(SIGCHLD, &act, NULL) != 0)
fatal("sigaction failed");
+ if (sigaction(SIGUSR1, &act, NULL) != 0)
+ fatal("sigaction failed");
+ if (sigaction(SIGUSR2, &act, NULL) != 0)
+ fatal("sigaction failed");
}
void