Add support for re-exec'ing with SIGHUP; equivalent to the already built-in

'restart' function.
This commit is contained in:
okan 2017-12-27 18:46:18 +00:00
parent 3d7c82936e
commit 156681f0a5
2 changed files with 13 additions and 0 deletions

View File

@ -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;

8
cwm.1
View File

@ -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,