The prior check causes abstract unix domain sockets to return unnamed on Android.
Signed-off-by: Nicholas Rishel <nick@accups.com>
This commit is contained in:
@@ -214,7 +214,7 @@ impl SocketAddr {
|
||||
let path = unsafe { mem::transmute::<&[libc::c_char], &[u8]>(&self.addr.sun_path) };
|
||||
|
||||
// macOS seems to return a len of 16 and a zeroed sun_path for unnamed addresses
|
||||
if len == 0 || (cfg!(not(target_os = "linux")) && self.addr.sun_path[0] == 0) {
|
||||
if len == 0 || (cfg!(not(any(target_os = "linux", target_os = "android"))) && self.addr.sun_path[0] == 0) {
|
||||
AddressKind::Unnamed
|
||||
} else if self.addr.sun_path[0] == 0 {
|
||||
AddressKind::Abstract(&path[1..len])
|
||||
|
||||
Reference in New Issue
Block a user