diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2009-05-16 10:02:51 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2009-05-16 10:02:51 +0000 |
commit | 03af7c99b58d65cd9ec0a95e02658c152e18f41e (patch) | |
tree | 9027df02bbdf4d2c6556acaef4479b15dbd60c15 /tmux.c | |
parent | 92de1ad6c833ec8253e07be2a10689b7f5f2c9a6 (diff) | |
download | rtmux-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.c | 18 |
1 files changed, 13 insertions, 5 deletions
@@ -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 |