Skip to content

Commit

Permalink
Silence the deprecation warning about time_t.
Browse files Browse the repository at this point in the history
  • Loading branch information
sunfishcode committed Jan 17, 2023
1 parent b6a6d76 commit 7d4f5f4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/backend/libc/net/syscalls.rs
Expand Up @@ -555,6 +555,11 @@ pub(crate) mod sockopt {
return Err(io::Errno::INVAL);
}

// 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
Expand Down

0 comments on commit 7d4f5f4

Please sign in to comment.