diff options
| author | Christiaan Dirkx <christiaan@dirkx.email> | 2021-02-13 00:00:54 +0100 |
|---|---|---|
| committer | Christiaan Dirkx <christiaan@dirkx.email> | 2021-04-18 09:29:22 +0200 |
| commit | 9f589b023fd4e38b6c14b5b174a8e5814c822fb0 (patch) | |
| tree | 7709c67fa9ea41e455fd869093d5fa8cef87733a | |
| parent | 4a15bd8eaff4f749113dc49bbcf877e34593726b (diff) | |
| download | rust-9f589b023fd4e38b6c14b5b174a8e5814c822fb0.tar.gz rust-9f589b023fd4e38b6c14b5b174a8e5814c822fb0.zip | |
Update `decode_error_kind` to decode os errors to `NotSupported`
| -rw-r--r-- | library/std/src/sys/unix/mod.rs | 1 | ||||
| -rw-r--r-- | library/std/src/sys/vxworks/mod.rs | 1 | ||||
| -rw-r--r-- | library/std/src/sys/wasi/mod.rs | 1 | ||||
| -rw-r--r-- | library/std/src/sys/windows/mod.rs | 1 |
4 files changed, 4 insertions, 0 deletions
diff --git a/library/std/src/sys/unix/mod.rs b/library/std/src/sys/unix/mod.rs index 44328ffc22e..7b99e0fe1f9 100644 --- a/library/std/src/sys/unix/mod.rs +++ b/library/std/src/sys/unix/mod.rs @@ -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 diff --git a/library/std/src/sys/vxworks/mod.rs b/library/std/src/sys/vxworks/mod.rs index c20edaa1a47..95e4baf3a6d 100644 --- a/library/std/src/sys/vxworks/mod.rs +++ b/library/std/src/sys/vxworks/mod.rs @@ -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 diff --git a/library/std/src/sys/wasi/mod.rs b/library/std/src/sys/wasi/mod.rs index a0a37ef8316..c772fc0be69 100644 --- a/library/std/src/sys/wasi/mod.rs +++ b/library/std/src/sys/wasi/mod.rs @@ -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, } } diff --git a/library/std/src/sys/windows/mod.rs b/library/std/src/sys/windows/mod.rs index 0353c9811f1..c8fada3c0c2 100644 --- a/library/std/src/sys/windows/mod.rs +++ b/library/std/src/sys/windows/mod.rs @@ -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, _ => {} } |
