From c0692f1f95a1b417248820486dcd5523d918c319 Mon Sep 17 00:00:00 2001 From: Ben Wiederhake Date: Sat, 13 Feb 2021 10:27:01 +0100 Subject: [PATCH] Kernel: Avoid magic number in sys$poll --- Kernel/Syscalls/select.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Kernel/Syscalls/select.cpp b/Kernel/Syscalls/select.cpp index f906545932..8010e37248 100644 --- a/Kernel/Syscalls/select.cpp +++ b/Kernel/Syscalls/select.cpp @@ -147,8 +147,7 @@ int Process::sys$poll(Userspace user_params) if (!copy_from_user(¶ms, user_params)) return -EFAULT; - // This limit is just a number from the place where numbers come from. - if (params.nfds >= 16384) + if (params.nfds >= m_max_open_file_descriptors) return -ENOBUFS; Thread::BlockTimeout timeout;