From 2144649e64a463462f82a756aa682deb6141cafd Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sun, 29 Nov 2020 13:34:53 +0100 Subject: [PATCH] Fix compilation on Haiku MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sin_len and sin6_len are apparently required on all BSD-like systems, from which Haiku probably inherits its network stack. sin_zero has been changed from 8 bytes to 24 bytes in hrev9079 in order to stay compatible with BeOS. --- src/sockaddr.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/sockaddr.rs b/src/sockaddr.rs index 434163fe..dd8ffc01 100644 --- a/src/sockaddr.rs +++ b/src/sockaddr.rs @@ -216,10 +216,11 @@ impl From for SockAddr { sin_family: AF_INET as sa_family_t, sin_port: addr.port().to_be(), sin_addr, - sin_zero: [0; 8], + sin_zero: Default::default(), #[cfg(any( target_os = "dragonfly", target_os = "freebsd", + target_os = "haiku", target_os = "ios", target_os = "macos", target_os = "netbsd", @@ -268,6 +269,7 @@ impl From for SockAddr { #[cfg(any( target_os = "dragonfly", target_os = "freebsd", + target_os = "haiku", target_os = "ios", target_os = "macos", target_os = "netbsd",