1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 04:28:13 +00:00

Kernel: getpeername() should fail with ENOTCONN for non-connected sockets.

This commit is contained in:
Andreas Kling 2019-05-23 15:39:52 +02:00
parent 709893364d
commit 14a202f011

View file

@ -2266,6 +2266,9 @@ int Process::sys$getpeername(int sockfd, sockaddr* addr, socklen_t* addrlen)
auto& socket = *descriptor->socket();
if (!socket.is_connected())
return -ENOTCONN;
if (!socket.get_peer_address(addr, addrlen))
return -EINVAL; // FIXME: Should this be another error? I'm not sure.