mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-03 17:58:49 +00:00
Kernel: listen() should fail with EINVAL for already-connected sockets
This according to POSIX.
This commit is contained in:
parent
66a9c233be
commit
23a2e84873
Notes:
sideshowbarker
2024-07-19 11:02:57 +09:00
Author: https://github.com/awesomekling
Commit: 23a2e84873
1 changed files with 2 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue