From 00319c248c86bf8454cb1eb11104321d9a8bb671 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 14 Feb 2019 16:03:37 +0100 Subject: [PATCH] Kernel: Let's say that listening+bound sockets "can read." This will make it easy-peasy to select() on a socket file descriptor to wait for incoming connections together with other activities. --- Kernel/LocalSocket.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Kernel/LocalSocket.cpp b/Kernel/LocalSocket.cpp index 055ef40fd5..6a0eabc435 100644 --- a/Kernel/LocalSocket.cpp +++ b/Kernel/LocalSocket.cpp @@ -97,6 +97,9 @@ RetainPtr LocalSocket::connect(const sockaddr* address, socklen_t addres bool LocalSocket::can_read(SocketRole role) const { + if (m_bound && is_listening()) + return can_accept(); + if (role == SocketRole::Accepted) return !m_for_server.is_empty(); else