From b01e4b171d421affc373e9733946f686491f0987 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 5 Sep 2021 16:18:24 +0200 Subject: [PATCH] Kernel: Use TRY() in sys$mknod() --- Kernel/Syscalls/mknod.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Kernel/Syscalls/mknod.cpp b/Kernel/Syscalls/mknod.cpp index 7fb599dc47..89f9bba8b6 100644 --- a/Kernel/Syscalls/mknod.cpp +++ b/Kernel/Syscalls/mknod.cpp @@ -19,10 +19,8 @@ KResultOr Process::sys$mknod(Userspace return EFAULT; if (!is_superuser() && !is_regular_file(params.mode) && !is_fifo(params.mode) && !is_socket(params.mode)) return EPERM; - auto path = get_syscall_path_argument(params.path); - if (path.is_error()) - return path.error(); - return VirtualFileSystem::the().mknod(path.value()->view(), params.mode & ~umask(), params.dev, current_directory()); + auto path = TRY(get_syscall_path_argument(params.path)); + return VirtualFileSystem::the().mknod(path->view(), params.mode & ~umask(), params.dev, current_directory()); } }