From 2adf37a96f7d23964494764d3ebc4e788711acf2 Mon Sep 17 00:00:00 2001 From: okan Date: Wed, 27 Dec 2017 18:46:18 +0000 Subject: Add support for re-exec'ing with SIGHUP; equivalent to the already built-in 'restart' function. --- calmwm.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'calmwm.c') diff --git a/calmwm.c b/calmwm.c index 20e3346..ff4568b 100644 --- a/calmwm.c +++ b/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 @@ -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; -- cgit v1.2.3-2-gb3c3