@@ -57,17 +57,11 @@ struct Config {
5757 dev : u64 ,
5858
5959 /// Set security context (SELinux/SMACK).
60- #[ cfg( any(
61- all( feature = "selinux" , any( target_os = "android" , target_os = "linux" ) ) ,
62- all( feature = "smack" , target_os = "linux" ) ,
63- ) ) ]
60+ #[ cfg( any( selinux, smack) ) ]
6461 set_security_context : bool ,
6562
6663 /// Specific security context (SELinux/SMACK).
67- #[ cfg( any(
68- all( feature = "selinux" , any( target_os = "android" , target_os = "linux" ) ) ,
69- all( feature = "smack" , target_os = "linux" ) ,
70- ) ) ]
64+ #[ cfg( any( selinux, smack) ) ]
7165 context : Option < String > ,
7266}
7367
@@ -102,7 +96,7 @@ fn mknod(file_name: &str, config: Config) -> i32 {
10296 }
10397
10498 // Apply SELinux context if requested
105- #[ cfg( all ( feature = " selinux" , any ( target_os = "android" , target_os = "linux" ) ) ) ]
99+ #[ cfg( selinux) ]
106100 if config. set_security_context {
107101 use std:: io:: Write as _;
108102
@@ -118,7 +112,7 @@ fn mknod(file_name: &str, config: Config) -> i32 {
118112 }
119113
120114 // Apply SMACK context if requested
121- #[ cfg( all ( feature = " smack" , target_os = "linux" ) ) ]
115+ #[ cfg( smack) ]
122116 if config. set_security_context {
123117 use std:: io:: Write as _;
124118
@@ -156,15 +150,9 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
156150 . expect ( "Missing argument 'NAME'" ) ;
157151
158152 // Extract the security context related flags and options
159- #[ cfg( any(
160- all( feature = "selinux" , any( target_os = "android" , target_os = "linux" ) ) ,
161- all( feature = "smack" , target_os = "linux" ) ,
162- ) ) ]
153+ #[ cfg( any( selinux, smack) ) ]
163154 let set_security_context = matches. get_flag ( options:: SECURITY_CONTEXT ) ;
164- #[ cfg( any(
165- all( feature = "selinux" , any( target_os = "android" , target_os = "linux" ) ) ,
166- all( feature = "smack" , target_os = "linux" ) ,
167- ) ) ]
155+ #[ cfg( any( selinux, smack) ) ]
168156 let context = matches. get_one :: < String > ( options:: CONTEXT ) . cloned ( ) ;
169157
170158 let dev = match (
@@ -193,15 +181,9 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
193181 file_type : file_type. clone ( ) ,
194182 use_umask,
195183 dev,
196- #[ cfg( any(
197- all( feature = "selinux" , any( target_os = "android" , target_os = "linux" ) ) ,
198- all( feature = "smack" , target_os = "linux" ) ,
199- ) ) ]
184+ #[ cfg( any( selinux, smack) ) ]
200185 set_security_context : set_security_context || context. is_some ( ) ,
201- #[ cfg( any(
202- all( feature = "selinux" , any( target_os = "android" , target_os = "linux" ) ) ,
203- all( feature = "smack" , target_os = "linux" ) ,
204- ) ) ]
186+ #[ cfg( any( selinux, smack) ) ]
205187 context,
206188 } ;
207189
0 commit comments