Skip to content

Commit 88947f3

Browse files
linkmauveThomasdezeeuw
authored andcommitted
Fix compilation on Haiku
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.
1 parent e431ce0 commit 88947f3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/sockaddr.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,11 @@ impl From<SocketAddrV4> for SockAddr {
131131
sin_family: AF_INET as sa_family_t,
132132
sin_port: addr.port().to_be(),
133133
sin_addr: crate::sys::to_in_addr(&addr.ip()),
134-
sin_zero: [0; 8],
134+
sin_zero: Default::default(),
135135
#[cfg(any(
136136
target_os = "dragonfly",
137137
target_os = "freebsd",
138+
target_os = "haiku",
138139
target_os = "ios",
139140
target_os = "macos",
140141
target_os = "netbsd",
@@ -173,6 +174,7 @@ impl From<SocketAddrV6> for SockAddr {
173174
#[cfg(any(
174175
target_os = "dragonfly",
175176
target_os = "freebsd",
177+
target_os = "haiku",
176178
target_os = "ios",
177179
target_os = "macos",
178180
target_os = "netbsd",

0 commit comments

Comments
 (0)