sync: remove Android workaround

The libc crate now exposes Android's sync like other unix platforms.
This commit is contained in:
Justin Tracey
2025-05-27 22:26:32 -04:00
parent d6de30eef1
commit f8d6eea2dc
+1 -5
View File
@@ -38,13 +38,9 @@ mod platform {
use uucore::error::UResult;
/// # Safety
/// This function is unsafe because it calls `libc::sync` or `libc::syscall` which are unsafe.
/// This function is unsafe because it calls `libc::sync` which is unsafe.
pub unsafe fn do_sync() -> UResult<()> {
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();
}
Ok(())