From ca2cf9265e2030a9098f18315e3addde7f518192 Mon Sep 17 00:00:00 2001 From: Federico Angelilli Date: Mon, 18 Nov 2024 23:29:26 +0100 Subject: Refactor --- src/comet.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/comet.c') diff --git a/src/comet.c b/src/comet.c index 1522bf7..d5eb03f 100644 --- a/src/comet.c +++ b/src/comet.c @@ -71,7 +71,11 @@ int main(int argc, char **argv) if (config_file != NULL) { log_info("Reading config '%s'", config_path); - config_read(&config, config_file); + int errors = config_read(&config, config_file); + if (errors > 0) { + log_error("Config file contained %d errors", errors); + return EXIT_FAILURE; + } } signal(SIGINT, signal_quit); @@ -96,7 +100,12 @@ int main(int argc, char **argv) .height = config.height, }; - block_t *block = config_resolve(&config); + block_t *block = NULL; + if (config_resolve(&config, &block) > 0) { + log_error("Config could not be resolved"); + return EXIT_FAILURE; + } + log_debug("Starting bar"); window_resize(&window, config.width, config.height); -- cgit v1.2.3