Skip to content

Commit

Permalink
feat: fix code
Browse files Browse the repository at this point in the history
  • Loading branch information
oowl committed Apr 2, 2024
1 parent 47e45ee commit 51b5910
Show file tree
Hide file tree
Showing 4 changed files with 437 additions and 9 deletions.
11 changes: 6 additions & 5 deletions src/mount/apple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ libc_bitflags!(
MNT_AUTOMOUNTED;
/// filesystem is journaled
MNT_JOURNALED;
/// Don't allow user extended attributes
/// Don't allow user extended attributes
MNT_NOUSERXATTR;
/// filesystem should defer writes
/// filesystem should defer writes
MNT_DEFWRITE;
/// don't block unmount if not responding
MNT_NOBLOCK;
Expand Down Expand Up @@ -93,17 +93,18 @@ pub fn mount<
}
}

let res = source.with_nix_path(|s|
let res = source.with_nix_path(|s| {
target.with_nix_path(|t| {
with_opt_nix_path(data, |d| unsafe {
libc::mount(
s.as_ptr(),
t.as_ptr(),
flags.bits(),
d.cast_mut() as *mut libc::c_void,
d.cast_mut().cast(),
)
})
}))???;
})
})???;

Errno::result(res).map(drop)
}
Expand Down
Loading

0 comments on commit 51b5910

Please sign in to comment.