diff options
author | Drew DeVault <sir@cmpwn.com> | 2016-12-17 15:19:50 -0500 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2016-12-17 15:21:57 -0500 |
commit | 1172566d4e298aa6c3555a0d606af4ff31d0db48 (patch) | |
tree | a6afcfbbecef26cc6ecaac0fad75268175fe9a51 /sway/config.c | |
parent | Merge pull request #996 from woutershep/datadir (diff) | |
download | sway-1172566d4e298aa6c3555a0d606af4ff31d0db48.tar.gz sway-1172566d4e298aa6c3555a0d606af4ff31d0db48.tar.zst sway-1172566d4e298aa6c3555a0d606af4ff31d0db48.zip |
Change how security config is loaded0.11-rc3
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 4164cefa..8af8cfdd 100644 --- a/sway/config.c +++ b/sway/config.c | |||
@@ -452,8 +452,11 @@ static char *get_config_path(void) { | |||
452 | return NULL; // Not reached | 452 | return NULL; // Not reached |
453 | } | 453 | } |
454 | 454 | ||
455 | const char *current_config_path; | ||
456 | |||
455 | static bool load_config(const char *path, struct sway_config *config) { | 457 | static bool load_config(const char *path, struct sway_config *config) { |
456 | sway_log(L_INFO, "Loading config from %s", path); | 458 | sway_log(L_INFO, "Loading config from %s", path); |
459 | current_config_path = path; | ||
457 | 460 | ||
458 | struct stat sb; | 461 | struct stat sb; |
459 | if (stat(path, &sb) == 0 && S_ISDIR(sb.st_mode)) { | 462 | if (stat(path, &sb) == 0 && S_ISDIR(sb.st_mode)) { |
@@ -474,11 +477,11 @@ static bool load_config(const char *path, struct sway_config *config) { | |||
474 | bool config_load_success = read_config(f, config); | 477 | bool config_load_success = read_config(f, config); |
475 | fclose(f); | 478 | fclose(f); |
476 | 479 | ||
477 | |||
478 | if (!config_load_success) { | 480 | if (!config_load_success) { |
479 | sway_log(L_ERROR, "Error(s) loading config!"); | 481 | sway_log(L_ERROR, "Error(s) loading config!"); |
480 | } | 482 | } |
481 | 483 | ||
484 | current_config_path = NULL; | ||
482 | return true; | 485 | return true; |
483 | } | 486 | } |
484 | 487 | ||
@@ -509,7 +512,8 @@ bool load_main_config(const char *file, bool is_active) { | |||
509 | list_add(config->config_chain, path); | 512 | list_add(config->config_chain, path); |
510 | 513 | ||
511 | config->reading = true; | 514 | config->reading = true; |
512 | bool success = load_config(path, config); | 515 | bool success = load_config(SYSCONFDIR "/sway/security", config); |
516 | success = success && load_config(path, config); | ||
513 | 517 | ||
514 | if (is_active) { | 518 | if (is_active) { |
515 | config->reloading = false; | 519 | config->reloading = false; |