timespec clone followup for redox
This commit is contained in:
@@ -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(),
|
||||
}
|
||||
});
|
||||
|
||||
@@ -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(),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user