Skip to content

Commit c668d7e

Browse files
committed
Say "invalid" instead of "illegal".
There's nothing illegal about using an invalid lseek offset, an invalid character encoding.
1 parent a275575 commit c668d7e

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

c-scape/src/error_str.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ pub(crate) const fn error_str(e: Errno) -> Option<&'static str> {
3131
Errno::FBIG => "File too large",
3232
Errno::HOSTUNREACH => "Host is unreachable",
3333
Errno::IDRM => "Identifier removed",
34-
Errno::ILSEQ => "Illegal byte sequence",
34+
Errno::ILSEQ => "Invalid byte sequence",
3535
Errno::INPROGRESS => "Operation in progress",
3636
Errno::INTR => "Interrupted function",
3737
Errno::INVAL => "Invalid argument",
@@ -92,10 +92,7 @@ pub(crate) const fn error_str(e: Errno) -> Option<&'static str> {
9292
Errno::PROTOTYPE => "Protocol wrong type for socket",
9393
Errno::RANGE => "Result too large",
9494
Errno::ROFS => "Read-only file system",
95-
#[cfg(target_env = "musl")]
9695
Errno::SPIPE => "Invalid seek",
97-
#[cfg(not(target_env = "musl"))]
98-
Errno::SPIPE => "Illegal seek",
9996
Errno::SRCH => "No such process",
10097
Errno::STALE => "Reserved",
10198
#[cfg(not(target_os = "wasi"))]

c-scape/src/signal/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ unsafe extern "C" fn strsignal(sig: c_int) -> *mut c_char {
421421
Signal::Cont => cstr!("Continue executing, if stopped").as_ptr() as _,
422422
Signal::Fpe => cstr!("Erroneous arithmetic operation").as_ptr() as _,
423423
Signal::Hup => cstr!("Hangup").as_ptr() as _,
424-
Signal::Ill => cstr!("Illegal instruction").as_ptr() as _,
424+
Signal::Ill => cstr!("Invalid instruction").as_ptr() as _,
425425
Signal::Int => cstr!("Terminal interrupt signal").as_ptr() as _,
426426
Signal::Kill => cstr!("Kill (cannot be caught or ignored)").as_ptr() as _,
427427
Signal::Pipe => cstr!("Write on a pipe with no one to read it").as_ptr() as _,

0 commit comments

Comments
 (0)