From 9cb6396677de6381a5578cdc563572776bf5c54a Mon Sep 17 00:00:00 2001 From: Tudor Roman Date: Thu, 3 Jan 2019 20:37:10 +0200 Subject: [PATCH] print cause of error when loading the config file is not possible --- wm.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/wm.c b/wm.c index a2bd972..fe3d7e4 100644 --- a/wm.c +++ b/wm.c @@ -3620,11 +3620,14 @@ load_defaults(void) static void load_config(char *config_path) { - if (fork() == 0) { + int f = fork(); + if (f == 0) { setsid(); DMSG("loading %s\n", config_path); execl(config_path, config_path, NULL); - errx(EXIT_FAILURE, "couldn't load config file"); + err(EXIT_FAILURE, "couldn't load config file"); + } else if (f == -1) { + err(EXIT_FAILURE, NULL); } }