@@ -87,7 +87,7 @@ fn test_posix_realpath_errors() {
8787 assert_eq ! ( e. kind( ) , ErrorKind :: NotFound ) ;
8888}
8989
90- #[ cfg( any ( target_os = "linux" ) ) ]
90+ #[ cfg( target_os = "linux" ) ]
9191fn test_posix_fadvise ( ) {
9292 use std:: convert:: TryInto ;
9393 use std:: io:: Write ;
@@ -115,7 +115,7 @@ fn test_posix_fadvise() {
115115 assert_eq ! ( result, 0 ) ;
116116}
117117
118- #[ cfg( any ( target_os = "linux" ) ) ]
118+ #[ cfg( target_os = "linux" ) ]
119119fn test_sync_file_range ( ) {
120120 use std:: io:: Write ;
121121
@@ -181,7 +181,7 @@ fn test_thread_local_errno() {
181181}
182182
183183/// Tests whether clock support exists at all
184- #[ cfg( any ( target_os = "linux" ) ) ]
184+ #[ cfg( target_os = "linux" ) ]
185185fn test_clocks ( ) {
186186 let mut tp = std:: mem:: MaybeUninit :: < libc:: timespec > :: uninit ( ) ;
187187 let is_error = unsafe { libc:: clock_gettime ( libc:: CLOCK_REALTIME , tp. as_mut_ptr ( ) ) } ;
@@ -283,23 +283,21 @@ fn test_posix_mkstemp() {
283283}
284284
285285fn main ( ) {
286- #[ cfg( any( target_os = "linux" ) ) ]
287- test_posix_fadvise ( ) ;
288-
289286 test_posix_gettimeofday ( ) ;
290287 test_posix_mkstemp ( ) ;
291288
292289 test_posix_realpath_alloc ( ) ;
293290 test_posix_realpath_noalloc ( ) ;
294291 test_posix_realpath_errors ( ) ;
295292
296- #[ cfg( any( target_os = "linux" ) ) ]
297- test_sync_file_range ( ) ;
298-
299293 test_thread_local_errno ( ) ;
300294
301- #[ cfg( any( target_os = "linux" ) ) ]
302- test_clocks ( ) ;
303-
304295 test_isatty ( ) ;
296+
297+ #[ cfg( target_os = "linux" ) ]
298+ {
299+ test_posix_fadvise ( ) ;
300+ test_sync_file_range ( ) ;
301+ test_clocks ( ) ;
302+ }
305303}
0 commit comments