mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
Merge pull request #7942 from cakebaker/sync_move_function_call_to_unsafe_block
sync: move call to unsafe fn to unsafe block
This commit is contained in:
commit
a7b005c5e3
1 changed files with 3 additions and 3 deletions
|
@ -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<()> {
|
||||
unsafe {
|
||||
// see https://github.com/rust-lang/libc/pull/2161
|
||||
#[cfg(target_os = "android")]
|
||||
libc::syscall(libc::SYS_sync);
|
||||
unsafe {
|
||||
#[cfg(not(target_os = "android"))]
|
||||
libc::sync();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue