From e5a2aa2fd0fbbf0345f0c24a08ee45a0d9e2199d Mon Sep 17 00:00:00 2001 From: oech3 <79379754+oech3@users.noreply.github.com> Date: Mon, 30 Mar 2026 18:37:23 +0900 Subject: [PATCH] coreutils: strip errno --- src/bin/coreutils.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/bin/coreutils.rs b/src/bin/coreutils.rs index f81f40ff67b..84c7ff0ab85 100644 --- a/src/bin/coreutils.rs +++ b/src/bin/coreutils.rs @@ -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);