diff options
author | Brian Ashworth <bosrsf04@gmail.com> | 2018-08-02 21:37:29 -0400 |
---|---|---|
committer | Brian Ashworth <bosrsf04@gmail.com> | 2018-08-03 10:37:35 -0400 |
commit | a7f7d4a488c8d3b2461122765f9904c8a411a583 (patch) | |
tree | 7abee51265a8b9550c62255d0c6649935ee1d6a2 /sway/commands/include.c | |
parent | Show swaynag on config errors (diff) | |
download | sway-a7f7d4a488c8d3b2461122765f9904c8a411a583.tar.gz sway-a7f7d4a488c8d3b2461122765f9904c8a411a583.tar.zst sway-a7f7d4a488c8d3b2461122765f9904c8a411a583.zip |
Write to swaynag pipe fd directly on config errors
Diffstat (limited to 'sway/commands/include.c')
-rw-r--r-- | sway/commands/include.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/sway/commands/include.c b/sway/commands/include.c index 72fec7cc..61f383bb 100644 --- a/sway/commands/include.c +++ b/sway/commands/include.c | |||
@@ -7,19 +7,10 @@ struct cmd_results *cmd_include(int argc, char **argv) { | |||
7 | return error; | 7 | return error; |
8 | } | 8 | } |
9 | 9 | ||
10 | char *errors = NULL; | 10 | if (!load_include_configs(argv[0], config, |
11 | if (!load_include_configs(argv[0], config, &errors)) { | 11 | &config->swaynag_config_errors)) { |
12 | struct cmd_results *result = cmd_results_new(CMD_INVALID, "include", | 12 | return cmd_results_new(CMD_INVALID, "include", |
13 | "Failed to include sub configuration file: %s", argv[0]); | 13 | "Failed to include sub configuration file: %s", argv[0]); |
14 | free(errors); | ||
15 | return result; | ||
16 | } | ||
17 | |||
18 | if (errors) { | ||
19 | struct cmd_results *result = cmd_results_new(CMD_INVALID, "include", | ||
20 | "There are errors in the included config\n%s", errors); | ||
21 | free(errors); | ||
22 | return result; | ||
23 | } | 14 | } |
24 | 15 | ||
25 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); | 16 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); |