diff --git a/src/common/validation.rs b/src/common/validation.rs index 41f686e8d83..f1bdccde331 100644 --- a/src/common/validation.rs +++ b/src/common/validation.rs @@ -6,6 +6,7 @@ // spell-checker:ignore prefixcat testcat use std::ffi::{OsStr, OsString}; +use std::io::{Write, stderr}; use std::path::{Path, PathBuf}; use std::process; @@ -25,13 +26,18 @@ pub fn get_all_utilities( /// Prints a "utility not found" error and exits pub fn not_found(util: &OsStr) -> ! { - eprintln!("{}: function/utility not found", util.maybe_quote()); + let _ = writeln!( + stderr(), + "coreutils: unknown program '{}'", + util.maybe_quote() + ); process::exit(1); } /// Prints an "unrecognized option" error and exits pub fn unrecognized_option(binary_name: &str, option: &OsStr) -> ! { - eprintln!( + let _ = writeln!( + stderr(), "{}: unrecognized option '{}'", binary_name, option.to_string_lossy() diff --git a/util/build-gnu.sh b/util/build-gnu.sh index 70886e5e912..9187a4b33d9 100755 --- a/util/build-gnu.sh +++ b/util/build-gnu.sh @@ -170,8 +170,6 @@ sed -i 's/^print_ver_.*/require_selinux_/' tests/chcon/chcon-fail.sh # We use coreutils yes sed -i "s|--coreutils-prog=||g" tests/misc/coreutils.sh -# Different message -sed -i "s|coreutils: unknown program 'blah'|blah: function/utility not found|" tests/misc/coreutils.sh # Use the system coreutils where the test fails due to error in a util that is not the one being tested sed -i "s|grep '^#define HAVE_CAP 1' \$CONFIG_HEADER > /dev/null|true|" tests/ls/capability.sh