summaryrefslogtreecommitdiff
path: root/Kernel/Syscalls
diff options
context:
space:
mode:
Diffstat (limited to 'Kernel/Syscalls')
-rw-r--r--Kernel/Syscalls/socket.cpp20
1 files changed, 9 insertions, 11 deletions
diff --git a/Kernel/Syscalls/socket.cpp b/Kernel/Syscalls/socket.cpp
index 8811c37571..4f3b0f0286 100644
--- a/Kernel/Syscalls/socket.cpp
+++ b/Kernel/Syscalls/socket.cpp
@@ -67,17 +67,15 @@ ErrorOr<FlatPtr> Process::sys$listen(int sockfd, int backlog)
VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this)
if (backlog < 0)
return EINVAL;
- return m_fds.with_exclusive([&](auto& fds) -> ErrorOr<FlatPtr> {
- auto description = TRY(fds.open_file_description(sockfd));
- if (!description->is_socket())
- return ENOTSOCK;
- auto& socket = *description->socket();
- REQUIRE_PROMISE_FOR_SOCKET_DOMAIN(socket.domain());
- if (socket.is_connected())
- return EINVAL;
- TRY(socket.listen(backlog));
- return 0;
- });
+ auto description = TRY(open_file_description(sockfd));
+ if (!description->is_socket())
+ return ENOTSOCK;
+ auto& socket = *description->socket();
+ REQUIRE_PROMISE_FOR_SOCKET_DOMAIN(socket.domain());
+ if (socket.is_connected())
+ return EINVAL;
+ TRY(socket.listen(backlog));
+ return 0;
}
ErrorOr<FlatPtr> Process::sys$accept4(Userspace<Syscall::SC_accept4_params const*> user_params)