mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:07:36 +00:00
Kernel: Use TRY() in sys$mknod()
This commit is contained in:
parent
2658ab4a80
commit
b01e4b171d
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;
|
return EFAULT;
|
||||||
if (!is_superuser() && !is_regular_file(params.mode) && !is_fifo(params.mode) && !is_socket(params.mode))
|
if (!is_superuser() && !is_regular_file(params.mode) && !is_fifo(params.mode) && !is_socket(params.mode))
|
||||||
return EPERM;
|
return EPERM;
|
||||||
auto path = get_syscall_path_argument(params.path);
|
auto path = TRY(get_syscall_path_argument(params.path));
|
||||||
if (path.is_error())
|
return VirtualFileSystem::the().mknod(path->view(), params.mode & ~umask(), params.dev, current_directory());
|
||||||
return path.error();
|
|
||||||
return VirtualFileSystem::the().mknod(path.value()->view(), params.mode & ~umask(), params.dev, current_directory());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue