From f0fd6119cffd22c1bdf5553cc2a729839840d63e Mon Sep 17 00:00:00 2001 From: Brian Ashworth Date: Tue, 29 Jan 2019 13:18:53 -0500 Subject: Cleanup config reading failure error logs This cleans up the log when sway fails to read a config file. The following changes have been made: - A missing error message has been added to the log when the config file is a directory instead of a regular file - In main, `goto` statements have been added after the `sway_terminate` calls instead of wrapping every block in `if (!terminate_request)` - Unnecessary NULL-checks around calls to free in `main` have been removed - Deferred command execution has been extracted to a separate function and the `Running deferred commands` log message will not be shown when there are no deferred commands. --- include/sway/config.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include/sway') diff --git a/include/sway/config.h b/include/sway/config.h index 8215ff59..d5467a56 100644 --- a/include/sway/config.h +++ b/include/sway/config.h @@ -515,6 +515,11 @@ bool load_include_configs(const char *path, struct sway_config *config, bool read_config(FILE *file, struct sway_config *config, struct swaynag_instance *swaynag); +/** + * Run the commands that were deferred when reading the config file. + */ +void run_deferred_commands(void); + /** * Adds a warning entry to the swaynag instance used for errors. */ -- cgit v1.2.3