diff --git a/Kernel/Process.cpp b/Kernel/Process.cpp index e30414aa818..6436ab72627 100644 --- a/Kernel/Process.cpp +++ b/Kernel/Process.cpp @@ -151,7 +151,7 @@ ErrorOr> Process::try_create_user_process(RefPtr& auto name = TRY(KString::try_create(parts.last())); auto process = TRY(Process::try_create(first_thread, move(name), uid, gid, ProcessID(0), false, VirtualFileSystem::the().root_custody(), nullptr, tty)); - TRY(process->m_fds.try_resize(process->m_fds.max_open())); + TRY(process->m_fds.try_resize(Process::OpenFileDescriptions::max_open())); auto& device_to_use_as_tty = tty ? (CharacterDevice&)*tty : DeviceManagement::the().null_device(); auto description = TRY(device_to_use_as_tty.open(O_RDWR)); diff --git a/Kernel/Process.h b/Kernel/Process.h index db0b6110793..b957f62938e 100644 --- a/Kernel/Process.h +++ b/Kernel/Process.h @@ -663,9 +663,9 @@ public: ErrorOr try_resize(size_t size) { return m_fds_metadatas.try_resize(size); } - size_t max_open() const + static constexpr size_t max_open() { - return m_max_open_file_descriptors; + return s_max_open_file_descriptors; } void clear() @@ -678,7 +678,7 @@ public: private: OpenFileDescriptions() = default; - static constexpr size_t m_max_open_file_descriptors { FD_SETSIZE }; + static constexpr size_t s_max_open_file_descriptors { FD_SETSIZE }; mutable Spinlock m_fds_lock; Vector m_fds_metadatas; };