1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-08-01 05:27:45 +00:00

sort: fix test_tmp_files_deleted_on_sigint, wait for signal handling at

the end of the program
This commit is contained in:
Niyaz Nigmatullin 2022-08-10 12:15:27 +03:00
parent 33e4b96675
commit 50f1e9a5fa
2 changed files with 7 additions and 1 deletions

View file

@ -1267,7 +1267,9 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
settings.init_precomputed();
exec(&mut files, &settings, output, &mut tmp_dir)
let result = exec(&mut files, &settings, output, &mut tmp_dir);
tmp_dir.wait_if_signal();
result
}
pub fn uu_app<'a>() -> Command<'a> {

View file

@ -69,6 +69,10 @@ impl TmpDirWrapper {
path,
))
}
pub fn wait_if_signal(&self) {
let _ = self.lock.lock().unwrap();
}
}
/// Remove the directory at `path` by deleting its child files and then itself.