mirror of
https://github.com/leahneukirchen/cwm.git
synced 2023-08-10 21:13:12 +03:00
Add support for SIGINT/SIGTERM.
This commit is contained in:
parent
6c7b8261df
commit
0a7d8cc5c4
11
calmwm.c
11
calmwm.c
@ -89,9 +89,10 @@ main(int argc, char **argv)
|
|||||||
argc -= optind;
|
argc -= optind;
|
||||||
argv += optind;
|
argv += optind;
|
||||||
|
|
||||||
if (signal(SIGCHLD, sighdlr) == SIG_ERR)
|
if (signal(SIGCHLD, sighdlr) == SIG_ERR ||
|
||||||
err(1, "signal");
|
signal(SIGHUP, sighdlr) == SIG_ERR ||
|
||||||
if (signal(SIGHUP, sighdlr) == SIG_ERR)
|
signal(SIGINT, sighdlr) == SIG_ERR ||
|
||||||
|
signal(SIGTERM, sighdlr) == SIG_ERR)
|
||||||
err(1, "signal");
|
err(1, "signal");
|
||||||
|
|
||||||
if (parse_config(Conf.conf_file, &Conf) == -1) {
|
if (parse_config(Conf.conf_file, &Conf) == -1) {
|
||||||
@ -216,6 +217,10 @@ sighdlr(int sig)
|
|||||||
case SIGHUP:
|
case SIGHUP:
|
||||||
cwm_status = CWM_EXEC_WM;
|
cwm_status = CWM_EXEC_WM;
|
||||||
break;
|
break;
|
||||||
|
case SIGINT:
|
||||||
|
case SIGTERM:
|
||||||
|
cwm_status = CWM_QUIT;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
errno = save_errno;
|
errno = save_errno;
|
||||||
|
Loading…
Reference in New Issue
Block a user