mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
Kernel: Use TRY() in sys$mknod()
This commit is contained in:
parent
2658ab4a80
commit
b01e4b171d
Notes:
sideshowbarker
2024-07-18 04:42:03 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/b01e4b171d4
1 changed files with 2 additions and 4 deletions
|
@ -19,10 +19,8 @@ KResultOr<FlatPtr> Process::sys$mknod(Userspace<const Syscall::SC_mknod_params*>
|
|||
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());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue