From 6081dff94aa3128f0742c24e3925a6f8e7f5de53 Mon Sep 17 00:00:00 2001 From: Alexander von Gluck IV Date: Tue, 8 Dec 2020 08:34:30 -0600 Subject: [PATCH] haiku: Fix sockaddr_in/sockaddr_in6; Solves #108 --- src/socket.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/socket.rs b/src/socket.rs index 17566d8..d9e92e0 100644 --- a/src/socket.rs +++ b/src/socket.rs @@ -118,14 +118,18 @@ fn addr2raw_v4(addr: &SocketAddrV4) -> (SocketAddrCRepr, c::socklen_t) { sin_family: c::AF_INET as c::sa_family_t, sin_port: addr.port().to_be(), sin_addr, + #[cfg(not(target_os = "haiku"))] sin_zero: [0; 8], + #[cfg(target_os = "haiku")] + sin_zero: [0; 24], #[cfg(any( target_os = "dragonfly", target_os = "freebsd", target_os = "ios", target_os = "macos", target_os = "netbsd", - target_os = "openbsd" + target_os = "openbsd", + target_os = "haiku", ))] sin_len: 0, }, @@ -173,7 +177,8 @@ fn addr2raw_v6(addr: &SocketAddrV6) -> (SocketAddrCRepr, c::socklen_t) { target_os = "ios", target_os = "macos", target_os = "netbsd", - target_os = "openbsd" + target_os = "openbsd", + target_os = "haiku", ))] sin6_len: 0, #[cfg(any(target_os = "solaris", target_os = "illumos"))]