diff --git a/core/src/thread_parker/linux.rs b/core/src/thread_parker/linux.rs index 5d4e229a..92601f62 100644 --- a/core/src/thread_parker/linux.rs +++ b/core/src/thread_parker/linux.rs @@ -80,10 +80,10 @@ impl super::ThreadParkerT for ThreadParker { self.park(); return true; } - let ts = libc::timespec { - tv_sec: diff.as_secs() as libc::time_t, - tv_nsec: diff.subsec_nanos() as tv_nsec_t, - }; + // SAFETY: libc::timespec is zero initializable. + let mut ts: libc::timespec = std::mem::zeroed(); + ts.tv_sec = diff.as_secs() as libc::time_t; + ts.tv_nsec = diff.subsec_nanos() as tv_nsec_t; self.futex_wait(Some(ts)); } true