From 1517bcabf55f6d2b46a9065035523906873108a0 Mon Sep 17 00:00:00 2001 From: Christian Meusel Date: Fri, 2 Aug 2024 19:38:12 +0200 Subject: [PATCH] Allow using time_t despite deprecation on musl --- src/posix/poll.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/posix/poll.rs b/src/posix/poll.rs index f8a59bac..6d0f46cd 100644 --- a/src/posix/poll.rs +++ b/src/posix/poll.rs @@ -63,6 +63,12 @@ fn poll_clamped(fd: &mut PollFd, timeout: Duration) -> nix::Result { } #[cfg(any(target_os = "linux", test))] +// The type time_t is deprecaten on musl. The nix crate internally uses this type and makes an +// exeption for the deprecation for musl. And so do we. +// +// See https://github.com/rust-lang/libc/issues/1848 which is referenced from every exemption used +// in nix. +#[cfg_attr(target_env = "musl", allow(deprecated))] fn clamped_time_spec(duration: Duration) -> TimeSpec { use nix::libc::c_long; use nix::sys::time::time_t;