swab(1): changes disparate error handling functions to one function

This commit is contained in:
Emma Tebibyte 2024-08-24 17:26:26 -06:00
parent 5eb71e90a3
commit ff4ff825bd
Signed by: emma
GPG Key ID: 06FA419A1698C270

View File

@ -35,15 +35,9 @@ use strerror::StrError;
#[cfg(target_os="openbsd")] extern crate openbsd; #[cfg(target_os="openbsd")] extern crate openbsd;
#[cfg(target_os="openbsd")] use openbsd::{ Promises, pledge }; #[cfg(target_os="openbsd")] use openbsd::{ Promises, pledge };
fn err(argv0: &str, e: Error, code: u8) -> ExitCode {
fn oserr(argv0: &str, e: Error) -> ExitCode {
eprintln!("{}: {}", argv0, e.strerror()); eprintln!("{}: {}", argv0, e.strerror());
ExitCode::from(EX_OSERR) ExitCode::from(code)
}
fn ioerr(argv0: &str, e: Error) -> ExitCode {
eprintln!("{}: {}", argv0, e.strerror());
ExitCode::from(EX_IOERR)
} }
fn usage(s: &str) -> ExitCode { fn usage(s: &str) -> ExitCode {