mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 00:36:51 +00:00
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:
parent
87ca02bee7
commit
d55492add4
1 changed files with 4 additions and 2 deletions
|
@ -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);
|
||||||
}
|
}
|
||||||
_ => (),
|
_ => (),
|
||||||
|
|
Loading…
Reference in a new issue