mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:48:12 +00:00
Kernel: Access OpenFileDescriptions::max_open() statically in Syscalls
This commit is contained in:
parent
c860e0ab95
commit
f38d32535c
4 changed files with 4 additions and 4 deletions
|
@ -16,7 +16,7 @@ ErrorOr<FlatPtr> Process::sys$dup2(int old_fd, int new_fd)
|
|||
auto description = TRY(fds().open_file_description(old_fd));
|
||||
if (old_fd == new_fd)
|
||||
return new_fd;
|
||||
if (new_fd < 0 || static_cast<size_t>(new_fd) >= fds().max_open())
|
||||
if (new_fd < 0 || static_cast<size_t>(new_fd) >= OpenFileDescriptions::max_open())
|
||||
return EINVAL;
|
||||
if (!m_fds.m_fds_metadatas[new_fd].is_allocated())
|
||||
m_fds.m_fds_metadatas[new_fd].allocate();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue