diff options
author | Andreas Kling <kling@serenityos.org> | 2021-09-05 17:56:40 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-09-05 17:56:40 +0200 |
commit | de2c1bc5c31e7cf408e614e4d1a4ae5e4d37c8a3 (patch) | |
tree | 316ef6c11b0ab0f75aa18fd05206e74023f9a58a /Kernel/Syscalls | |
parent | 4e4b7c272c88b32f127bbb0970e659ac5d04754f (diff) | |
download | serenity-de2c1bc5c31e7cf408e614e4d1a4ae5e4d37c8a3.zip |
Kernel: Use TRY() in sys$unlink()
Diffstat (limited to 'Kernel/Syscalls')
-rw-r--r-- | Kernel/Syscalls/unlink.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Kernel/Syscalls/unlink.cpp b/Kernel/Syscalls/unlink.cpp index 6178ac6cd4..cc23e5c75a 100644 --- a/Kernel/Syscalls/unlink.cpp +++ b/Kernel/Syscalls/unlink.cpp @@ -14,10 +14,8 @@ KResultOr<FlatPtr> Process::sys$unlink(Userspace<const char*> user_path, size_t { VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this) REQUIRE_PROMISE(cpath); - auto path = get_syscall_path_argument(user_path, path_length); - if (path.is_error()) - return path.error(); - return VirtualFileSystem::the().unlink(path.value()->view(), current_directory()); + auto path = TRY(get_syscall_path_argument(user_path, path_length)); + return VirtualFileSystem::the().unlink(path->view(), current_directory()); } } |