@@ -71,7 +71,7 @@ use alloc::borrow::ToOwned as _;
7171use alloc:: string:: String ;
7272#[ cfg( apple) ]
7373use c:: TCP_KEEPALIVE as TCP_KEEPIDLE ;
74- #[ cfg( not( any( apple, target_os = "openbsd " , target_os = "haiku " , target_os = "nto " ) ) ) ]
74+ #[ cfg( not( any( apple, target_os = "haiku " , target_os = "nto " , target_os = "openbsd " ) ) ) ]
7575use c:: TCP_KEEPIDLE ;
7676use core:: mem:: { size_of, MaybeUninit } ;
7777use core:: time:: Duration ;
@@ -887,9 +887,9 @@ pub(crate) fn tcp_nodelay(fd: BorrowedFd<'_>) -> io::Result<bool> {
887887
888888#[ inline]
889889#[ cfg( not( any(
890- target_os = "openbsd" ,
891890 target_os = "haiku" ,
892891 target_os = "nto" ,
892+ target_os = "openbsd" ,
893893 target_os = "redox"
894894) ) ) ]
895895pub ( crate ) fn set_tcp_keepcnt ( fd : BorrowedFd < ' _ > , count : u32 ) -> io:: Result < ( ) > {
@@ -898,34 +898,34 @@ pub(crate) fn set_tcp_keepcnt(fd: BorrowedFd<'_>, count: u32) -> io::Result<()>
898898
899899#[ inline]
900900#[ cfg( not( any(
901- target_os = "openbsd" ,
902901 target_os = "haiku" ,
903902 target_os = "nto" ,
903+ target_os = "openbsd" ,
904904 target_os = "redox"
905905) ) ) ]
906906pub ( crate ) fn tcp_keepcnt ( fd : BorrowedFd < ' _ > ) -> io:: Result < u32 > {
907907 getsockopt ( fd, c:: IPPROTO_TCP , c:: TCP_KEEPCNT )
908908}
909909
910910#[ inline]
911- #[ cfg( not( any( target_os = "openbsd " , target_os = "haiku " , target_os = "nto " ) ) ) ]
911+ #[ cfg( not( any( target_os = "haiku " , target_os = "nto " , target_os = "openbsd " ) ) ) ]
912912pub ( crate ) fn set_tcp_keepidle ( fd : BorrowedFd < ' _ > , duration : Duration ) -> io:: Result < ( ) > {
913913 let secs: c:: c_uint = duration_to_secs ( duration) ?;
914914 setsockopt ( fd, c:: IPPROTO_TCP , TCP_KEEPIDLE , secs)
915915}
916916
917917#[ inline]
918- #[ cfg( not( any( target_os = "openbsd " , target_os = "haiku " , target_os = "nto " ) ) ) ]
918+ #[ cfg( not( any( target_os = "haiku " , target_os = "nto " , target_os = "openbsd " ) ) ) ]
919919pub ( crate ) fn tcp_keepidle ( fd : BorrowedFd < ' _ > ) -> io:: Result < Duration > {
920920 let secs: c:: c_uint = getsockopt ( fd, c:: IPPROTO_TCP , TCP_KEEPIDLE ) ?;
921921 Ok ( Duration :: from_secs ( secs as u64 ) )
922922}
923923
924924#[ inline]
925925#[ cfg( not( any(
926- target_os = "openbsd" ,
927926 target_os = "haiku" ,
928927 target_os = "nto" ,
928+ target_os = "openbsd" ,
929929 target_os = "redox"
930930) ) ) ]
931931pub ( crate ) fn set_tcp_keepintvl ( fd : BorrowedFd < ' _ > , duration : Duration ) -> io:: Result < ( ) > {
@@ -935,9 +935,9 @@ pub(crate) fn set_tcp_keepintvl(fd: BorrowedFd<'_>, duration: Duration) -> io::R
935935
936936#[ inline]
937937#[ cfg( not( any(
938- target_os = "openbsd" ,
939938 target_os = "haiku" ,
940939 target_os = "nto" ,
940+ target_os = "openbsd" ,
941941 target_os = "redox"
942942) ) ) ]
943943pub ( crate ) fn tcp_keepintvl ( fd : BorrowedFd < ' _ > ) -> io:: Result < Duration > {
0 commit comments