Skip to content

Commit

Permalink
Merge pull request #5533 from cswn/split-remove-crash-macro
Browse files Browse the repository at this point in the history
split: remove crash macro
  • Loading branch information
cakebaker committed Nov 15, 2023
2 parents 9ec994c + c4580df commit 0db834e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/uu/split/src/platform/unix.rs
Expand Up @@ -7,9 +7,10 @@ use std::io::Write;
use std::io::{BufWriter, Error, ErrorKind, Result};
use std::path::Path;
use std::process::{Child, Command, Stdio};
use uucore::crash;
use uucore::error::USimpleError;
use uucore::fs;
use uucore::fs::FileInformation;
use uucore::show;

/// A writer that writes to a shell_process' stdin
///
Expand Down Expand Up @@ -101,10 +102,13 @@ impl Drop for FilterWriter {
.expect("Couldn't wait for child process");
if let Some(return_code) = exit_status.code() {
if return_code != 0 {
crash!(1, "Shell process returned {}", return_code);
show!(USimpleError::new(
1,
format!("Shell process returned {}", return_code)
));
}
} else {
crash!(1, "Shell process terminated by signal")
show!(USimpleError::new(1, "Shell process terminated by signal"));
}
}
}
Expand Down

0 comments on commit 0db834e

Please sign in to comment.