mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-25 10:48:41 +00:00
Kernel: listen() should fail with EINVAL for already-connected sockets
This according to POSIX.
This commit is contained in:
@@ -2438,6 +2438,8 @@ int Process::sys$listen(int sockfd, int backlog)
|
||||
if (!description->is_socket())
|
||||
return -ENOTSOCK;
|
||||
auto& socket = *description->socket();
|
||||
if (socket.is_connected())
|
||||
return -EINVAL;
|
||||
return socket.listen(backlog);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user