Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/uu/sort/src/tmp_dir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,15 @@ impl Drop for TmpDirWrapper {
guard.lock = None;
guard.path = None;
}
drop(guard);

// Explicitly attempt cleanup before TempDir's Drop runs silently.
// TempDir::drop uses `let _ = remove_dir_all()` which silently
// ignores errors, potentially leaking the directory.
#[cfg(not(any(target_os = "redox", target_os = "wasi")))]
if let Some(ref temp_dir) = self.temp_dir {
let _ = remove_tmp_dir(temp_dir.path());
}
}
}

Expand Down
Loading