mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-27 11:07:44 +00:00
Merge pull request #5533 from cswn/split-remove-crash-macro
split: remove crash macro
This commit is contained in:
commit
0db834e04c
1 changed files with 7 additions and 3 deletions
|
@ -7,9 +7,10 @@ use std::io::Write;
|
||||||
use std::io::{BufWriter, Error, ErrorKind, Result};
|
use std::io::{BufWriter, Error, ErrorKind, Result};
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
use std::process::{Child, Command, Stdio};
|
use std::process::{Child, Command, Stdio};
|
||||||
use uucore::crash;
|
use uucore::error::USimpleError;
|
||||||
use uucore::fs;
|
use uucore::fs;
|
||||||
use uucore::fs::FileInformation;
|
use uucore::fs::FileInformation;
|
||||||
|
use uucore::show;
|
||||||
|
|
||||||
/// A writer that writes to a shell_process' stdin
|
/// A writer that writes to a shell_process' stdin
|
||||||
///
|
///
|
||||||
|
@ -101,10 +102,13 @@ impl Drop for FilterWriter {
|
||||||
.expect("Couldn't wait for child process");
|
.expect("Couldn't wait for child process");
|
||||||
if let Some(return_code) = exit_status.code() {
|
if let Some(return_code) = exit_status.code() {
|
||||||
if return_code != 0 {
|
if return_code != 0 {
|
||||||
crash!(1, "Shell process returned {}", return_code);
|
show!(USimpleError::new(
|
||||||
|
1,
|
||||||
|
format!("Shell process returned {}", return_code)
|
||||||
|
));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
crash!(1, "Shell process terminated by signal")
|
show!(USimpleError::new(1, "Shell process terminated by signal"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue