aboutsummaryrefslogtreecommitdiffstats
path: root/calmwm.c
diff options
context:
space:
mode:
authorokan2017-12-27 18:46:18 +0000
committerokan2017-12-27 18:46:18 +0000
commit2adf37a96f7d23964494764d3ebc4e788711acf2 (patch)
treeac8650daab812e2acac556a59ef85aab542b4f3b /calmwm.c
parent73cf1b91165b5fcb06a93997af95f6f0cabddc2f (diff)
downloadcwm-2adf37a96f7d23964494764d3ebc4e788711acf2.tar.gz
Add support for re-exec'ing with SIGHUP; equivalent to the already built-in
'restart' function.
Diffstat (limited to 'calmwm.c')
-rw-r--r--calmwm.c7
1 files changed, 6 insertions, 1 deletions
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 <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;