coreutils: strip errno

This commit is contained in:
oech3
2026-03-31 19:12:31 +02:00
committed by Sylvestre Ledru
parent ff890746e5
commit 3b2a09ca85
+4 -4
View File
@@ -10,7 +10,7 @@ use std::cmp;
use std::ffi::OsString;
use std::io::{self, Write};
use std::process;
use uucore::Args;
use uucore::{Args, error::strip_errno};
const VERSION: &str = env!("CARGO_PKG_VERSION");
@@ -44,7 +44,7 @@ Currently defined functions:
if let Err(e) = writeln!(io::stdout(), "{s}")
&& e.kind() != io::ErrorKind::BrokenPipe
{
let _ = writeln!(io::stderr(), "coreutils: {e}");
let _ = writeln!(io::stderr(), "coreutils: {}", strip_errno(&e));
process::exit(1);
}
}
@@ -95,7 +95,7 @@ fn main() {
if let Err(e) = writeln!(out, "{util}")
&& e.kind() != io::ErrorKind::BrokenPipe
{
let _ = writeln!(io::stderr(), "coreutils: {e}");
let _ = writeln!(io::stderr(), "coreutils: {}", strip_errno(&e));
process::exit(1);
}
}
@@ -105,7 +105,7 @@ fn main() {
if let Err(e) = writeln!(io::stdout(), "coreutils {VERSION} (multi-call binary)")
&& e.kind() != io::ErrorKind::BrokenPipe
{
let _ = writeln!(io::stderr(), "coreutils: {e}");
let _ = writeln!(io::stderr(), "coreutils: {}", strip_errno(&e));
process::exit(1);
}
process::exit(0);