1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 22:27:35 +00:00

LibKeyboard: Don't assert on failure

This commit is contained in:
Ben Wiederhake 2021-01-30 22:41:29 +01:00 committed by Andreas Kling
parent d9e7e13fb2
commit 0e3408d4d6
4 changed files with 21 additions and 16 deletions

View file

@ -65,10 +65,17 @@ int main(int argc, char** argv)
return 0;
}
Keyboard::CharacterMap character_map(path);
int rc = character_map.set_system_map();
if (rc != 0)
auto character_map = Keyboard::CharacterMap::load_from_file(path);
if (!character_map.has_value()) {
warnln("Cannot read keymap {}", path);
warnln("Hint: Must be either a keymap name (e.g. 'en') or a full path.");
return 1;
}
int rc = character_map.value().set_system_map();
if (rc != 0) {
perror("setkeymap");
}
return rc;
}