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.
This commit is contained in:
Brian Ashworth 2019-01-29 13:18:53 -05:00
parent f49ad5977e
commit f0fd6119cf
3 changed files with 39 additions and 32 deletions

View file

@ -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.
*/