cksum --debug 2>/dev/full does not abort

This commit is contained in:
oech3
2026-01-31 03:42:44 +09:00
parent e5bf248762
commit abc6423700
+5 -3
View File
@@ -6,6 +6,7 @@
// spell-checker:ignore (ToDO) fname, algo, bitlen
use std::ffi::OsStr;
use std::io::{Write, stderr};
use clap::Command;
use uu_checksum_common::{ChecksumCommand, checksum_main, default_checksum_app, options};
@@ -16,18 +17,19 @@ use uucore::checksum::{
};
use uucore::error::UResult;
use uucore::hardware::{HasHardwareFeatures as _, SimdPolicy};
use uucore::{show_error, translate};
use uucore::translate;
/// Print CPU hardware capability detection information to stderr
/// 2>/dev/full does not abort
/// This matches GNU cksum's --debug behavior
fn print_cpu_debug_info() {
let features = SimdPolicy::detect();
fn print_feature(name: &str, available: bool) {
if available {
show_error!("using {name} hardware support");
let _ = writeln!(stderr(), "using {name} hardware support");
} else {
show_error!("{name} support not detected");
let _ = writeln!(stderr(), "{name} support not detected");
}
}