1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 19:47:45 +00:00

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 20:53:54 -04:00
parent d6de30eef1
commit f8d6eea2dc
No known key found for this signature in database
GPG key ID: 62B84F5ABDDDCE54

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(())