summaryrefslogtreecommitdiff
path: root/Kernel/Syscalls/read.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2022-01-29 01:22:28 +0100
committerAndreas Kling <kling@serenityos.org>2022-01-29 02:17:06 +0100
commit8ebec2938cd43d16655404ba86b20c73bfb724a7 (patch)
tree66af99284c69870ffc150c4137dedf8811147f3a /Kernel/Syscalls/read.cpp
parent93e90e16c3857badd86991b8dcca4c5ebc3ed5a7 (diff)
downloadserenity-8ebec2938cd43d16655404ba86b20c73bfb724a7.zip
Kernel: Convert process file descriptor table to a SpinlockProtected
Instead of manually locking in the various member functions of Process::OpenFileDescriptions, simply wrap it in a SpinlockProtected.
Diffstat (limited to 'Kernel/Syscalls/read.cpp')
-rw-r--r--Kernel/Syscalls/read.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Kernel/Syscalls/read.cpp b/Kernel/Syscalls/read.cpp
index 21916c7a57..a19106a7f5 100644
--- a/Kernel/Syscalls/read.cpp
+++ b/Kernel/Syscalls/read.cpp
@@ -12,9 +12,9 @@ namespace Kernel {
using BlockFlags = Thread::FileBlocker::BlockFlags;
-static ErrorOr<NonnullRefPtr<OpenFileDescription>> open_readable_file_description(Process::OpenFileDescriptions const& fds, int fd)
+static ErrorOr<NonnullRefPtr<OpenFileDescription>> open_readable_file_description(auto& fds, int fd)
{
- auto description = TRY(fds.open_file_description(fd));
+ auto description = TRY(fds.with([&](auto& fds) { return fds.open_file_description(fd); }));
if (!description->is_readable())
return EBADF;
if (description->is_directory())