summaryrefslogtreecommitdiff
path: root/Kernel/Syscalls/keymap.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-09-05 18:00:31 +0200
committerAndreas Kling <kling@serenityos.org>2021-09-05 18:15:05 +0200
commitd53c60fd9fb53980f0a150c4568d874c173fa47f (patch)
tree1e539647ce15bfc2d45ace52ef72ac80706a0edf /Kernel/Syscalls/keymap.cpp
parent1f475f7bbcc816e91f54d72b003b2d10b91bbef8 (diff)
downloadserenity-d53c60fd9fb53980f0a150c4568d874c173fa47f.zip
Kernel: Use TRY() in sys$setkeymap()
Diffstat (limited to 'Kernel/Syscalls/keymap.cpp')
-rw-r--r--Kernel/Syscalls/keymap.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/Kernel/Syscalls/keymap.cpp b/Kernel/Syscalls/keymap.cpp
index 1b68b0a6a3..665508456c 100644
--- a/Kernel/Syscalls/keymap.cpp
+++ b/Kernel/Syscalls/keymap.cpp
@@ -29,13 +29,11 @@ KResultOr<FlatPtr> Process::sys$setkeymap(Userspace<const Syscall::SC_setkeymap_
TRY(copy_n_from_user(character_map_data.altgr_map, params.altgr_map, CHAR_MAP_SIZE));
TRY(copy_n_from_user(character_map_data.shift_altgr_map, params.shift_altgr_map, CHAR_MAP_SIZE));
- auto map_name = get_syscall_path_argument(params.map_name);
- if (map_name.is_error())
- return map_name.error();
- if (map_name.value()->length() > map_name_max_size)
+ auto map_name = TRY(get_syscall_path_argument(params.map_name));
+ if (map_name->length() > map_name_max_size)
return ENAMETOOLONG;
- HIDManagement::the().set_maps(character_map_data, map_name.value()->view());
+ HIDManagement::the().set_maps(character_map_data, map_name->view());
return 0;
}