Skip to content

Commit e00edab

Browse files
link2xtThomasdezeeuw
authored andcommitted
Fix compilation error on Haiku
A fixup for b0732a3
1 parent b0732a3 commit e00edab

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/sys/unix.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ pub(crate) type Bool = c_int;
137137

138138
#[cfg(target_vendor = "apple")]
139139
use libc::TCP_KEEPALIVE as KEEPALIVE_TIME;
140-
#[cfg(not(any(target_vendor = "apple")))]
140+
#[cfg(not(any(target_vendor = "apple", target_os = "haiku", target_os = "openbsd")))]
141141
use libc::TCP_KEEPIDLE as KEEPALIVE_TIME;
142142

143143
/// Helper macro to execute a system call that returns an `io::Result`.
@@ -873,6 +873,7 @@ pub(crate) fn keepalive_time(fd: Socket) -> io::Result<Duration> {
873873
}
874874
}
875875

876+
#[allow(unused_variables)]
876877
pub(crate) fn set_tcp_keepalive(fd: Socket, keepalive: &TcpKeepalive) -> io::Result<()> {
877878
#[cfg(not(any(target_os = "haiku", target_os = "openbsd")))]
878879
if let Some(time) = keepalive.time {
@@ -904,6 +905,7 @@ pub(crate) fn set_tcp_keepalive(fd: Socket, keepalive: &TcpKeepalive) -> io::Res
904905
Ok(())
905906
}
906907

908+
#[cfg(not(any(target_os = "haiku", target_os = "openbsd")))]
907909
fn into_secs(duration: Duration) -> c_int {
908910
min(duration.as_secs(), c_int::max_value() as u64) as c_int
909911
}

0 commit comments

Comments
 (0)