main: Exit on failed keyboard initialisation

Fixes #122
pull/127/head
Andri Yngvason 2022-01-01 13:56:23 +00:00
parent ead9cdf121
commit fba97621e2
1 changed files with 5 additions and 2 deletions

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2019 - 2021 Andri Yngvason * Copyright (c) 2019 - 2022 Andri Yngvason
* *
* Permission to use, copy, modify, and/or distribute this software for any * Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above * purpose with or without fee is hereby granted, provided that the above
@ -892,7 +892,10 @@ int main(int argc, char* argv[])
.options = self.cfg.xkb_options, .options = self.cfg.xkb_options,
}; };
keyboard_init(&self.keyboard_backend, &rule_names); if (keyboard_init(&self.keyboard_backend, &rule_names) < 0) {
log_error("Failed to initialise keyboard\n");
goto failure;
}
self.pointer_backend.vnc = self.nvnc; self.pointer_backend.vnc = self.nvnc;
self.pointer_backend.output = self.selected_output; self.pointer_backend.output = self.selected_output;