timespec clone followup for redox

This commit is contained in:
auronandace
2026-03-11 14:51:06 +00:00
parent 293a2e991d
commit 3ea60eeb72
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -1367,7 +1367,7 @@ impl Pal for Sys {
Self::clock_gettime(timer_st.clockid, Out::from_mut(&mut now))?;
if timer_st.evp.sigev_notify == SIGEV_NONE {
if timespec::subtract(timer_st.next_wake_time.it_value, now).is_none() {
if timespec::subtract(timer_st.next_wake_time.it_value.clone(), now.clone()).is_none() {
// error here means the timer is disarmed
let _ = timer_update_wake_time(timer_st);
}
@@ -1378,8 +1378,8 @@ impl Pal for Sys {
itimerspec::default()
} else {
itimerspec {
it_interval: timer_st.next_wake_time.it_interval,
it_value: timespec::subtract(timer_st.next_wake_time.it_value, now)
it_interval: timer_st.next_wake_time.it_interval.clone(),
it_value: timespec::subtract(timer_st.next_wake_time.it_value.clone(), now)
.unwrap_or_default(),
}
});
+1 -1
View File
@@ -86,7 +86,7 @@ pub(crate) fn timer_update_wake_time(timer_st: &mut timer_internal_t) -> Result<
} else {
let mut now = timespec::default();
Sys::clock_gettime(timer_st.clockid, Out::from_mut(&mut now))?;
let next_time = match timespec::add(now, timer_st.next_wake_time.it_interval) {
let next_time = match timespec::add(now, timer_st.next_wake_time.it_interval.clone()) {
Some(a) => a,
None => timespec::default(),
};