From 42403ff18b87182275590236e57ca7e0f990d492 Mon Sep 17 00:00:00 2001 From: Piotr Kubaj Date: Thu, 2 Feb 2023 13:46:04 +0000 Subject: sysutils/fselect: add upstream commit that fixes armv7 It also fixes build on powerpc. (cherry picked from commit 91c0d1c49f9f31c2122aca54b822535f0f94c630) --- ...crates_rustix-0.34.6_src_imp_libc_net_syscalls.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 sysutils/fselect/files/patch-cargo-crates_rustix-0.34.6_src_imp_libc_net_syscalls.rs diff --git a/sysutils/fselect/files/patch-cargo-crates_rustix-0.34.6_src_imp_libc_net_syscalls.rs b/sysutils/fselect/files/patch-cargo-crates_rustix-0.34.6_src_imp_libc_net_syscalls.rs new file mode 100644 index 000000000000..b15774f12d70 --- /dev/null +++ b/sysutils/fselect/files/patch-cargo-crates_rustix-0.34.6_src_imp_libc_net_syscalls.rs @@ -0,0 +1,20 @@ +--- cargo-crates/rustix-0.34.6/src/imp/libc/net/syscalls.rs.orig 2023-02-02 13:18:53 UTC ++++ cargo-crates/rustix-0.34.6/src/imp/libc/net/syscalls.rs +@@ -548,11 +548,12 @@ pub(crate) mod sockopt { + return Err(io::Error::INVAL); + } + +- let tv_sec = timeout.as_secs().try_into(); +- #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] +- let tv_sec = tv_sec.unwrap_or(c::c_long::MAX); +- #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] +- let tv_sec = tv_sec.unwrap_or(i64::MAX); ++ // Rust's musl libc bindings deprecated `time_t` while they ++ // transition to 64-bit `time_t`. What we want here is just ++ // "whatever type `timeval`'s `tv_sec` is", so we're ok using ++ // the deprecated type. ++ #[allow(deprecated)] ++ let tv_sec = timeout.as_secs().try_into().unwrap_or(c::time_t::MAX); + + // `subsec_micros` rounds down, so we use `subsec_nanos` and + // manually round up. -- cgit v1.2.3