Skip to content

Commit e83cd99

Browse files
committed
coreutils: Fix 2>/dev/full aborts & drop a sed for GnuTests
1 parent bd71a30 commit e83cd99

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/common/validation.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
// spell-checker:ignore prefixcat testcat
77

88
use std::ffi::{OsStr, OsString};
9+
use std::io::{Write, stderr};
910
use std::path::{Path, PathBuf};
1011
use std::process;
1112

@@ -25,13 +26,18 @@ pub fn get_all_utilities<T: Args>(
2526

2627
/// Prints a "utility not found" error and exits
2728
pub fn not_found(util: &OsStr) -> ! {
28-
eprintln!("{}: function/utility not found", util.maybe_quote());
29+
let _ = writeln!(
30+
stderr(),
31+
"coreutils: unknown program '{}'",
32+
util.maybe_quote()
33+
);
2934
process::exit(1);
3035
}
3136

3237
/// Prints an "unrecognized option" error and exits
3338
pub fn unrecognized_option(binary_name: &str, option: &OsStr) -> ! {
34-
eprintln!(
39+
let _ = writeln!(
40+
stderr(),
3541
"{binary_name}: unrecognized option '{}'",
3642
option.to_string_lossy()
3743
);

util/build-gnu.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,6 @@ sed -i 's/^print_ver_.*/require_selinux_/' tests/chcon/chcon-fail.sh
184184

185185
# We use coreutils yes
186186
sed -i "s|--coreutils-prog=||g" tests/misc/coreutils.sh
187-
# Different message
188-
sed -i "s|coreutils: unknown program 'blah'|blah: function/utility not found|" tests/misc/coreutils.sh
189187

190188
# Use the system coreutils where the test fails due to error in a util that is not the one being tested
191189
sed -i "s|grep '^#define HAVE_CAP 1' \$CONFIG_HEADER > /dev/null|true|" tests/ls/capability.sh

0 commit comments

Comments
 (0)