diff options
author | Okan Demirmen <okan@cvs.openbsd.org> | 2017-12-27 18:46:19 +0000 |
---|---|---|
committer | Okan Demirmen <okan@cvs.openbsd.org> | 2017-12-27 18:46:19 +0000 |
commit | 840940052b69ff4b86b3a3043a4a15bb15ef79e1 (patch) | |
tree | c8465cf2a7435863416066d94676216afb2712fb /app | |
parent | 4cbe1cb5b962ca12c572ca6a88efd5215a13e6f5 (diff) |
Add support for re-exec'ing with SIGHUP; equivalent to the already built-in
'restart' function.
Diffstat (limited to 'app')
-rw-r--r-- | app/cwm/calmwm.c | 7 | ||||
-rw-r--r-- | app/cwm/cwm.1 | 12 |
2 files changed, 16 insertions, 3 deletions
diff --git a/app/cwm/calmwm.c b/app/cwm/calmwm.c index 20e3346a9..ff4568b5f 100644 --- a/app/cwm/calmwm.c +++ b/app/cwm/calmwm.c @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: calmwm.c,v 1.104 2017/12/27 17:04:35 okan Exp $ + * $OpenBSD: calmwm.c,v 1.105 2017/12/27 18:46:18 okan Exp $ */ #include <sys/types.h> @@ -82,6 +82,8 @@ main(int argc, char **argv) if (signal(SIGCHLD, sighdlr) == SIG_ERR) err(1, "signal"); + if (signal(SIGHUP, sighdlr) == SIG_ERR) + err(1, "signal"); Conf.homedir = getenv("HOME"); if ((Conf.homedir == NULL) || (Conf.homedir[0] == '\0')) { @@ -221,6 +223,9 @@ sighdlr(int sig) (pid < 0 && errno == EINTR)) ; break; + case SIGHUP: + cwm_status = CWM_EXEC_WM; + break; } errno = save_errno; diff --git a/app/cwm/cwm.1 b/app/cwm/cwm.1 index 8da9de005..2bf5ee0d0 100644 --- a/app/cwm/cwm.1 +++ b/app/cwm/cwm.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: cwm.1,v 1.58 2017/07/21 15:55:37 okan Exp $ +.\" $OpenBSD: cwm.1,v 1.59 2017/12/27 18:46:18 okan Exp $ .\" .\" Copyright (c) 2004,2005 Marius Aamodt Eriksen <marius@monkey.org> .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: July 21 2017 $ +.Dd $Mdocdate: December 27 2017 $ .Dt CWM 1 .Os .Sh NAME @@ -184,6 +184,14 @@ List all available items. .It Ic [Esc] Cancel. .El +.Pp +.Nm +rereads its configuration file when it receives a hangup signal, +.Dv SIGHUP , +by executing itself with the name and arguments with which it was started. +This is equivilant to the +.Ar restart +function. .Sh SEARCH .Nm features the ability to search for windows by their current title, |