swab(1): fixes not using strerror(3)

This commit is contained in:
Emma Tebibyte 2024-07-07 18:21:48 -06:00
parent d1eefcb37e
commit cf744efc1b
Signed by untrusted user: emma
GPG Key ID: 06FA419A1698C270

View File

@ -29,8 +29,11 @@ use getopt::GetOpt;
extern crate sysexits; extern crate sysexits;
use sysexits::{ EX_OK, EX_OSERR, EX_USAGE }; use sysexits::{ EX_OK, EX_OSERR, EX_USAGE };
extern crate strerror;
use strerror::StrError;
fn oserr(s: &str, e: Error) -> ExitCode { fn oserr(s: &str, e: Error) -> ExitCode {
eprintln!("{}: {}", s, e); eprintln!("{}: {}", s, e.strerror());
ExitCode::from(EX_OSERR as u8) ExitCode::from(EX_OSERR as u8)
} }