mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-29 03:57:44 +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;
|
use uucore::error::UResult;
|
||||||
|
|
||||||
/// # Safety
|
/// # 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<()> {
|
pub unsafe fn do_sync() -> UResult<()> {
|
||||||
unsafe {
|
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();
|
libc::sync();
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue