File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ impl Protocol {
1414 // Currently, linux implementation doesn't use this function.
1515 // Without this #[cfg] clippy complains about dead code, and CI refuses
1616 // to pass.
17- #[ cfg( target_os = "macos" ) ]
17+ #[ cfg( all ( target_family = "unix" , not ( target_os = "linux" ) ) ) ]
1818 pub fn from_str ( string : & str ) -> Option < Self > {
1919 match string {
2020 "TCP" => Some ( Protocol :: Tcp ) ,
File renamed without changes.
Original file line number Diff line number Diff line change 11#[ cfg( target_os = "linux" ) ]
22pub ( self ) mod linux;
33
4- #[ cfg( target_os = "macos" ) ]
5- pub ( self ) mod macos ;
4+ #[ cfg( all ( target_family = "unix" , not ( target_os = "linux" ) ) ) ]
5+ pub ( self ) mod bsd ;
66
7- #[ cfg( target_os = "macos" ) ]
7+ #[ cfg( all ( target_family = "unix" , not ( target_os = "linux" ) ) ) ]
88mod lsof_utils;
99
1010mod shared;
Original file line number Diff line number Diff line change @@ -13,8 +13,8 @@ use signal_hook::iterator::Signals;
1313
1414#[ cfg( target_os = "linux" ) ]
1515use crate :: os:: linux:: get_open_sockets;
16- #[ cfg( target_os = "macos" ) ]
17- use crate :: os:: macos :: get_open_sockets;
16+ #[ cfg( all ( target_family = "unix" , not ( target_os = "linux" ) ) ) ]
17+ use crate :: os:: bsd :: get_open_sockets;
1818use crate :: { network:: dns, OsInputOutput } ;
1919
2020pub type OnSigWinch = dyn Fn ( Box < dyn Fn ( ) > ) + Send ;
@@ -143,7 +143,7 @@ pub fn get_input(
143143}
144144
145145#[ inline]
146- #[ cfg( target_os = "macos" ) ]
146+ #[ cfg( all ( target_family = "unix" , not ( target_os = "linux" ) ) ) ]
147147fn eperm_message ( ) -> & ' static str {
148148 "Insufficient permissions to listen on network interface(s). Try running with sudo."
149149}
You can’t perform that action at this time.
0 commit comments