From fba97621e236a8a6b0fb3702ef4ceaf405e5c46a Mon Sep 17 00:00:00 2001 From: Andri Yngvason Date: Sat, 1 Jan 2022 13:56:23 +0000 Subject: [PATCH] main: Exit on failed keyboard initialisation Fixes #122 --- src/main.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main.c b/src/main.c index 30d5466..6864a96 100644 --- a/src/main.c +++ b/src/main.c @@ -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 * 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, }; - 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.output = self.selected_output;