From cdca6d6a8dc170de09afbfbf79f9a083c35c2130 Mon Sep 17 00:00:00 2001 From: Daniel Hofstetter Date: Fri, 16 May 2025 15:14:21 +0200 Subject: [PATCH] sync: move call to unsafe fn to unsafe block --- src/uu/sync/src/sync.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/uu/sync/src/sync.rs b/src/uu/sync/src/sync.rs index 38d5f1044..abcdf4099 100644 --- a/src/uu/sync/src/sync.rs +++ b/src/uu/sync/src/sync.rs @@ -40,10 +40,10 @@ mod platform { /// # Safety /// This function is unsafe because it calls `libc::sync` or `libc::syscall` which are unsafe. pub unsafe fn do_sync() -> UResult<()> { - // see https://github.com/rust-lang/libc/pull/2161 - #[cfg(target_os = "android")] - libc::syscall(libc::SYS_sync); unsafe { + // see https://github.com/rust-lang/libc/pull/2161 + #[cfg(target_os = "android")] + libc::syscall(libc::SYS_sync); #[cfg(not(target_os = "android"))] libc::sync(); }