1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-29 12:07:46 +00:00

sort: ignore errors when waiting for child

This commit is contained in:
Michael Debertol 2021-06-06 19:53:28 +02:00
parent 6ee6082cf8
commit d6da143c4e

View file

@ -262,7 +262,10 @@ fn write_lines<'a, T: Write>(lines: &[Line<'a>], writer: &mut T, separator: u8)
}
fn assert_child_success(mut child: Child, program: &str) {
if !matches!(child.wait().map(|e| e.code()), Ok(Some(0)) | Ok(None)) {
if !matches!(
child.wait().map(|e| e.code()),
Ok(Some(0)) | Ok(None) | Err(_)
) {
crash!(2, "'{}' terminated abnormally", program)
}
}