diff options
author | Mikkel Oscar Lyderik <[email protected]> | 2016-03-24 22:13:42 +0100 |
---|---|---|
committer | Mikkel Oscar Lyderik <[email protected]> | 2016-03-24 22:20:25 +0100 |
commit | 938ff29b7b14d9840a92acb1d1ee4192bfc8e89e (patch) | |
tree | 9ed266fe8b9ab0f720d1defb28f085b26bf9cd98 /sway/config.c | |
parent | 06107bb44eddec993354883436767b931f2aa4d7 (diff) |
Gracefully exit when config is not found
This makes sure that sway will gracefully exit if the config is not
found or sway is unable to read it.
Diffstat (limited to 'sway/config.c')
-rw-r--r-- | sway/config.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sway/config.c b/sway/config.c index ebf7546d..a5fdf850 100644 --- a/sway/config.c +++ b/sway/config.c @@ -256,7 +256,7 @@ bool load_config(const char *file) { FILE *f = fopen(path, "r"); if (!f) { - fprintf(stderr, "Unable to open %s for reading", path); + sway_log(L_ERROR, "Unable to open %s for reading", path); free(path); return false; } @@ -272,7 +272,11 @@ bool load_config(const char *file) { update_active_bar_modifiers(); - return config_load_success; + if (!config_load_success) { + sway_log(L_ERROR, "Error(s) loading config!"); + } + + return true; } bool read_config(FILE *file, bool is_active) { |