aboutsummaryrefslogtreecommitdiff
path: root/sway
diff options
context:
space:
mode:
authorConnor E <38229097+c-edw@users.noreply.github.com>2019-02-05 14:37:22 +0000
committerConnor E <38229097+c-edw@users.noreply.github.com>2019-02-05 14:37:22 +0000
commit886789c1973ff1eb3cdcc20713c39c366fb38afe (patch)
tree17e92b98f80976772f04e25c0b56d08fc9e1de15 /sway
parentfb73f84d0e020d286ecb8d3c437ceac932e30d3a (diff)
If validating the config, do it as early as possible.
Diffstat (limited to 'sway')
-rw-r--r--sway/main.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/sway/main.c b/sway/main.c
index a3198af1..b3ffdd83 100644
--- a/sway/main.c
+++ b/sway/main.c
@@ -312,6 +312,18 @@ int main(int argc, char **argv) {
wlr_log_init(WLR_ERROR, NULL);
}
+ log_kernel();
+ log_distro();
+ log_env();
+ detect_proprietary(allow_unsupported_gpu);
+ detect_raspi();
+
+ if (validate) {
+ bool valid = load_main_config(config_path, false, true);
+ free(config_path);
+ return valid ? 0 : 1;
+ }
+
if (optind < argc) { // Behave as IPC client
if (optind != 1) {
sway_log(SWAY_ERROR, "Don't use options with the IPC client");
@@ -334,11 +346,6 @@ int main(int argc, char **argv) {
return 1;
}
- log_kernel();
- log_distro();
- detect_proprietary(allow_unsupported_gpu);
- detect_raspi();
-
if (!drop_permissions()) {
server_fini(&server);
exit(EXIT_FAILURE);
@@ -359,12 +366,6 @@ int main(int argc, char **argv) {
}
ipc_init(&server);
- log_env();
-
- if (validate) {
- bool valid = load_main_config(config_path, false, true);
- return valid ? 0 : 1;
- }
setenv("WAYLAND_DISPLAY", server.socket, true);
if (!load_main_config(config_path, false, false)) {