Handle getpeername other error

This commit is contained in:
Wildan M
2026-01-15 07:31:30 +07:00
parent af7636daba
commit e14a03fea4
+3
View File
@@ -778,6 +778,9 @@ impl PalSocket for Sys {
// TODO: in UDS dgram getpeername on listener always return ENOTCONN,
// it probably the expected error on usual getpeername call, but not here.
if let Err(e) = Self::getpeername(socket, address, address_len) {
if e.0 != ENOTCONN {
return Err(e);
}
let data = &mut *(address as *mut sockaddr);
data.sa_family = AF_UNSPEC as u16;
*address_len = 0;