ptp: Fix compilation with Rust 1.48

Use `ErrorKind::NotFound` instead of `ErrorKind::Unsupported` if the
`getrandom` syscall is not available. `Unsupported` was added in 1.53.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4647>
This commit is contained in:
Sebastian Dröge 2023-05-19 09:47:06 +03:00 committed by GStreamer Marge Bot
parent 87ca02bee7
commit d55492add4

View file

@ -21,7 +21,8 @@ mod unix {
// Depends on us knowing the syscall number // Depends on us knowing the syscall number
if SYS_getrandom == 0 { if SYS_getrandom == 0 {
return Err(io::Error::from(io::ErrorKind::Unsupported)); // FIXME: Use Unsupported once we can depend on 1.53
return Err(io::Error::from(io::ErrorKind::NotFound));
} }
struct GetRandom; struct GetRandom;
@ -127,7 +128,8 @@ mod unix {
Ok(n) => { Ok(n) => {
assert_ne!(n, [0u8; 8]); assert_ne!(n, [0u8; 8]);
} }
Err(err) if err.kind() != std::io::ErrorKind::Unsupported => { // FIXME: Use Unsupported once we can depend on 1.53
Err(err) if err.kind() != std::io::ErrorKind::NotFound => {
panic!("{}", err); panic!("{}", err);
} }
_ => (), _ => (),