Skip to content

Commit cdca6d6

Browse files
cakebakersylvestre
authored andcommitted
sync: move call to unsafe fn to unsafe block
1 parent 6a828f0 commit cdca6d6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/uu/sync/src/sync.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ mod platform {
4040
/// # Safety
4141
/// This function is unsafe because it calls `libc::sync` or `libc::syscall` which are unsafe.
4242
pub unsafe fn do_sync() -> UResult<()> {
43-
// see https://github.com/rust-lang/libc/pull/2161
44-
#[cfg(target_os = "android")]
45-
libc::syscall(libc::SYS_sync);
4643
unsafe {
44+
// see https://github.com/rust-lang/libc/pull/2161
45+
#[cfg(target_os = "android")]
46+
libc::syscall(libc::SYS_sync);
4747
#[cfg(not(target_os = "android"))]
4848
libc::sync();
4949
}

0 commit comments

Comments
 (0)