Skip to content

Commit a7b005c

Browse files
authored
Merge pull request #7942 from cakebaker/sync_move_function_call_to_unsafe_block
sync: move call to unsafe fn to unsafe block
2 parents 0c7a5d2 + cdca6d6 commit a7b005c

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)