@@ -87,7 +87,7 @@ fn test_posix_realpath_errors() {
87
87
assert_eq ! ( e. kind( ) , ErrorKind :: NotFound ) ;
88
88
}
89
89
90
- #[ cfg( any ( target_os = "linux" ) ) ]
90
+ #[ cfg( target_os = "linux" ) ]
91
91
fn test_posix_fadvise ( ) {
92
92
use std:: convert:: TryInto ;
93
93
use std:: io:: Write ;
@@ -115,7 +115,7 @@ fn test_posix_fadvise() {
115
115
assert_eq ! ( result, 0 ) ;
116
116
}
117
117
118
- #[ cfg( any ( target_os = "linux" ) ) ]
118
+ #[ cfg( target_os = "linux" ) ]
119
119
fn test_sync_file_range ( ) {
120
120
use std:: io:: Write ;
121
121
@@ -181,7 +181,7 @@ fn test_thread_local_errno() {
181
181
}
182
182
183
183
/// Tests whether clock support exists at all
184
- #[ cfg( any ( target_os = "linux" ) ) ]
184
+ #[ cfg( target_os = "linux" ) ]
185
185
fn test_clocks ( ) {
186
186
let mut tp = std:: mem:: MaybeUninit :: < libc:: timespec > :: uninit ( ) ;
187
187
let is_error = unsafe { libc:: clock_gettime ( libc:: CLOCK_REALTIME , tp. as_mut_ptr ( ) ) } ;
@@ -283,23 +283,21 @@ fn test_posix_mkstemp() {
283
283
}
284
284
285
285
fn main ( ) {
286
- #[ cfg( any( target_os = "linux" ) ) ]
287
- test_posix_fadvise ( ) ;
288
-
289
286
test_posix_gettimeofday ( ) ;
290
287
test_posix_mkstemp ( ) ;
291
288
292
289
test_posix_realpath_alloc ( ) ;
293
290
test_posix_realpath_noalloc ( ) ;
294
291
test_posix_realpath_errors ( ) ;
295
292
296
- #[ cfg( any( target_os = "linux" ) ) ]
297
- test_sync_file_range ( ) ;
298
-
299
293
test_thread_local_errno ( ) ;
300
294
301
- #[ cfg( any( target_os = "linux" ) ) ]
302
- test_clocks ( ) ;
303
-
304
295
test_isatty ( ) ;
296
+
297
+ #[ cfg( target_os = "linux" ) ]
298
+ {
299
+ test_posix_fadvise ( ) ;
300
+ test_sync_file_range ( ) ;
301
+ test_clocks ( ) ;
302
+ }
305
303
}
0 commit comments