aboutsummaryrefslogtreecommitdiff
path: root/sway/main.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2017-12-05 12:35:51 -0500
committerGitHub <noreply@github.com>2017-12-05 12:35:51 -0500
commit3fe64482bb269a3dcceeaf1107b9d59dc60eb8d0 (patch)
tree8fea86b5c928d551723426e196405e5f2f25de2e /sway/main.c
parentf2aa33ae0f6cd91b88a3f24b65e3e915c3960931 (diff)
parent7e81d304a3121e92f78527dcf1327e991b0089ac (diff)
Merge pull request #1498 from emersion/config
Add minimal config subsystem
Diffstat (limited to 'sway/main.c')
-rw-r--r--sway/main.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/sway/main.c b/sway/main.c
index bc107309..bc843591 100644
--- a/sway/main.c
+++ b/sway/main.c
@@ -15,6 +15,7 @@
#include <sys/capability.h>
#include <sys/prctl.h>
#endif
+#include "sway/config.h"
#include "sway/server.h"
#include "sway/layout.h"
#include "sway/ipc-server.h"
@@ -388,14 +389,14 @@ int main(int argc, char **argv) {
ipc_init(&server);
log_env();
- //if (validate) {
- // bool valid = load_main_config(config_path, false);
- // return valid ? 0 : 1;
- //}
+ if (validate) {
+ bool valid = load_main_config(config_path, false);
+ return valid ? 0 : 1;
+ }
- //if (!load_main_config(config_path, false)) {
- // sway_terminate(EXIT_FAILURE);
- //}
+ if (!load_main_config(config_path, false)) {
+ sway_terminate(EXIT_FAILURE);
+ }
if (config_path) {
free(config_path);
@@ -411,9 +412,9 @@ int main(int argc, char **argv) {
ipc_terminate();
- //if (config) {
- // free_config(config);
- //}
+ if (config) {
+ free_config(config);
+ }
return exit_value;
}