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:
parent
d6de30eef1
commit
f8d6eea2dc
1 changed files with 1 additions and 5 deletions
|
@ -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(())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue