Skip to content

Commit

Permalink
Fixing method os
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkKronicle committed Jan 14, 2024
1 parent b2e4cf2 commit 8ba855e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/freedesktop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ pub fn list() -> Result<Vec<TrashItem>, Error> {
// Get all mount-points and attempt to find a trash folder in each adding them to the SET of
// trash folders when found one.
let uid = unsafe { libc::getuid() };
let mount_points = get_sorted_mount_points()?;
for mount in &mount_points {
let sorted_mount_points = get_sorted_mount_points()?;
for mount in &sorted_mount_points {
execute_on_mounted_trash_folders(uid, &mount.mnt_dir, false, false, |trash_path| {
trash_folders.insert(trash_path);
Ok(())
Expand All @@ -98,7 +98,7 @@ pub fn list() -> Result<Vec<TrashItem>, Error> {
let mut result = Vec::new();
for folder in &trash_folders {
// Read the info files for every file
let top_dir = get_first_topdir_containing_path(folder, &mount_points);
let top_dir = get_first_topdir_containing_path(folder, &sorted_mount_points);
let info_folder = folder.join("info");
if !info_folder.is_dir() {
warn!("The path {:?} did not point to a directory, skipping this trash folder.", info_folder);
Expand Down Expand Up @@ -639,7 +639,6 @@ struct MountPoint {
_mnt_fsname: String,
}

#[cfg(target_os = "linux")]
fn get_sorted_mount_points() -> Result<Vec<MountPoint>, Error> {
// Returns longest mount points first
let mut mount_points = get_mount_points()?;
Expand Down

0 comments on commit 8ba855e

Please sign in to comment.