Skip to content

Commit

Permalink
one step closer
Browse files Browse the repository at this point in the history
  • Loading branch information
0323pin committed Sep 17, 2023
1 parent 0789b23 commit aee3dce
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/freedesktop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -702,12 +702,12 @@ fn get_mount_points() -> Result<Vec<MountPoint>, Error> {
std::str::from_utf8(buf).ok()
}
}
let mut fs_infos: *mut libc::statfs = std::ptr::null_mut();
let mut fs_infos: *mut libc::statvfs = std::ptr::null_mut();
let count = unsafe { libc::getmntinfo(&mut fs_infos, libc::MNT_WAIT) };
if count < 1 {
return Ok(Vec::new());
}
let fs_infos: &[libc::statfs] = unsafe { std::slice::from_raw_parts(fs_infos as _, count as _) };
let fs_infos: &[libc::statvfs] = unsafe { std::slice::from_raw_parts(fs_infos as _, count as _) };

let mut result = Vec::new();
for fs_info in fs_infos {
Expand Down

0 comments on commit aee3dce

Please sign in to comment.