Skip to content

Commit

Permalink
Allow using time_t despite deprecation on musl
Browse files Browse the repository at this point in the history
  • Loading branch information
sirhcel committed Aug 2, 2024
1 parent a192b66 commit b409430
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/posix/poll.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ fn poll_clamped(fd: &mut PollFd, timeout: Duration) -> nix::Result<c_int> {
}

#[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.
#[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;
Expand Down

0 comments on commit b409430

Please sign in to comment.