Skip to content

Commit 3b2a09c

Browse files
oech3sylvestre
authored andcommitted
coreutils: strip errno
1 parent ff89074 commit 3b2a09c

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/bin/coreutils.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use std::cmp;
1010
use std::ffi::OsString;
1111
use std::io::{self, Write};
1212
use std::process;
13-
use uucore::Args;
13+
use uucore::{Args, error::strip_errno};
1414

1515
const VERSION: &str = env!("CARGO_PKG_VERSION");
1616

@@ -44,7 +44,7 @@ Currently defined functions:
4444
if let Err(e) = writeln!(io::stdout(), "{s}")
4545
&& e.kind() != io::ErrorKind::BrokenPipe
4646
{
47-
let _ = writeln!(io::stderr(), "coreutils: {e}");
47+
let _ = writeln!(io::stderr(), "coreutils: {}", strip_errno(&e));
4848
process::exit(1);
4949
}
5050
}
@@ -95,7 +95,7 @@ fn main() {
9595
if let Err(e) = writeln!(out, "{util}")
9696
&& e.kind() != io::ErrorKind::BrokenPipe
9797
{
98-
let _ = writeln!(io::stderr(), "coreutils: {e}");
98+
let _ = writeln!(io::stderr(), "coreutils: {}", strip_errno(&e));
9999
process::exit(1);
100100
}
101101
}
@@ -105,7 +105,7 @@ fn main() {
105105
if let Err(e) = writeln!(io::stdout(), "coreutils {VERSION} (multi-call binary)")
106106
&& e.kind() != io::ErrorKind::BrokenPipe
107107
{
108-
let _ = writeln!(io::stderr(), "coreutils: {e}");
108+
let _ = writeln!(io::stderr(), "coreutils: {}", strip_errno(&e));
109109
process::exit(1);
110110
}
111111
process::exit(0);

0 commit comments

Comments
 (0)