From d55492add4bf66a0c9ac042655640e43fbd07165 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 19 May 2023 09:47:06 +0300 Subject: [PATCH] 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: --- subprojects/gstreamer/libs/gst/helpers/ptp/rand.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/subprojects/gstreamer/libs/gst/helpers/ptp/rand.rs b/subprojects/gstreamer/libs/gst/helpers/ptp/rand.rs index a89a371786..7b811e9038 100644 --- a/subprojects/gstreamer/libs/gst/helpers/ptp/rand.rs +++ b/subprojects/gstreamer/libs/gst/helpers/ptp/rand.rs @@ -21,7 +21,8 @@ mod unix { // Depends on us knowing the syscall number 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; @@ -127,7 +128,8 @@ mod unix { Ok(n) => { 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); } _ => (),