Skip to content

Commit c7f3621

Browse files
committed
The prior check causes abstract unix domain sockets to return unnamed on Android.
Signed-off-by: Nicholas Rishel <[email protected]>
1 parent 8a28d94 commit c7f3621

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libstd/sys/unix/ext/net.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ impl SocketAddr {
214214
let path = unsafe { mem::transmute::<&[libc::c_char], &[u8]>(&self.addr.sun_path) };
215215

216216
// macOS seems to return a len of 16 and a zeroed sun_path for unnamed addresses
217-
if len == 0 || (cfg!(not(target_os = "linux")) && self.addr.sun_path[0] == 0) {
217+
if len == 0 || (cfg!(not(any(target_os = "linux", target_os = "android"))) && self.addr.sun_path[0] == 0) {
218218
AddressKind::Unnamed
219219
} else if self.addr.sun_path[0] == 0 {
220220
AddressKind::Abstract(&path[1..len])

0 commit comments

Comments
 (0)