Update decode_error_kind
to decode os errors to NotSupported
This commit is contained in:
parent
4a15bd8eaf
commit
9f589b023f
@ -148,6 +148,7 @@ pub fn decode_error_kind(errno: i32) -> ErrorKind {
|
||||
libc::EINVAL => ErrorKind::InvalidInput,
|
||||
libc::ETIMEDOUT => ErrorKind::TimedOut,
|
||||
libc::EEXIST => ErrorKind::AlreadyExists,
|
||||
libc::ENOSYS => ErrorKind::NotSupported,
|
||||
|
||||
// These two constants can have the same value on some systems,
|
||||
// but different values on others, so we can't use a match
|
||||
|
@ -83,6 +83,7 @@ pub fn decode_error_kind(errno: i32) -> ErrorKind {
|
||||
libc::EINVAL => ErrorKind::InvalidInput,
|
||||
libc::ETIMEDOUT => ErrorKind::TimedOut,
|
||||
libc::EEXIST => ErrorKind::AlreadyExists,
|
||||
libc::ENOSYS => ErrorKind::NotSupported,
|
||||
|
||||
// These two constants can have the same value on some systems,
|
||||
// but different values on others, so we can't use a match
|
||||
|
@ -78,6 +78,7 @@ pub fn decode_error_kind(errno: i32) -> std_io::ErrorKind {
|
||||
wasi::ERRNO_TIMEDOUT => TimedOut,
|
||||
wasi::ERRNO_EXIST => AlreadyExists,
|
||||
wasi::ERRNO_AGAIN => WouldBlock,
|
||||
wasi::ERRNO_NOSYS => NotSupported,
|
||||
_ => Other,
|
||||
}
|
||||
}
|
||||
|
@ -78,6 +78,7 @@ pub fn decode_error_kind(errno: i32) -> ErrorKind {
|
||||
| c::ERROR_IPSEC_IKE_TIMED_OUT
|
||||
| c::ERROR_RUNLEVEL_SWITCH_TIMEOUT
|
||||
| c::ERROR_RUNLEVEL_SWITCH_AGENT_TIMEOUT => return ErrorKind::TimedOut,
|
||||
c::ERROR_CALL_NOT_IMPLEMENTED => return ErrorKind::NotSupported,
|
||||
_ => {}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user