mirror of
https://github.com/leahneukirchen/cwm.git
synced 2023-08-10 21:13:12 +03:00
Add support for re-exec'ing with SIGHUP; equivalent to the already built-in
'restart' function.
This commit is contained in:
parent
3d7c82936e
commit
156681f0a5
5
calmwm.c
5
calmwm.c
@ -82,6 +82,8 @@ main(int argc, char **argv)
|
|||||||
|
|
||||||
if (signal(SIGCHLD, sighdlr) == SIG_ERR)
|
if (signal(SIGCHLD, sighdlr) == SIG_ERR)
|
||||||
err(1, "signal");
|
err(1, "signal");
|
||||||
|
if (signal(SIGHUP, sighdlr) == SIG_ERR)
|
||||||
|
err(1, "signal");
|
||||||
|
|
||||||
Conf.homedir = getenv("HOME");
|
Conf.homedir = getenv("HOME");
|
||||||
if ((Conf.homedir == NULL) || (Conf.homedir[0] == '\0')) {
|
if ((Conf.homedir == NULL) || (Conf.homedir[0] == '\0')) {
|
||||||
@ -221,6 +223,9 @@ sighdlr(int sig)
|
|||||||
(pid < 0 && errno == EINTR))
|
(pid < 0 && errno == EINTR))
|
||||||
;
|
;
|
||||||
break;
|
break;
|
||||||
|
case SIGHUP:
|
||||||
|
cwm_status = CWM_EXEC_WM;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
errno = save_errno;
|
errno = save_errno;
|
||||||
|
8
cwm.1
8
cwm.1
@ -184,6 +184,14 @@ List all available items.
|
|||||||
.It Ic [Esc]
|
.It Ic [Esc]
|
||||||
Cancel.
|
Cancel.
|
||||||
.El
|
.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
|
.Sh SEARCH
|
||||||
.Nm
|
.Nm
|
||||||
features the ability to search for windows by their current title,
|
features the ability to search for windows by their current title,
|
||||||
|
Loading…
Reference in New Issue
Block a user