Merge pull request #27752 from DaanDeMeyer/timer-oncalendar-fix

core/timer: Always use inactive_exit_timestamp if it is set
This commit is contained in:
Daan De Meyer
2023-05-24 14:39:32 +02:00
committed by GitHub

View File

@@ -399,14 +399,12 @@ static void timer_enter_waiting(Timer *t, bool time_change) {
* to that. If we don't, just start from
* the activation time. */
if (t->last_trigger.realtime > 0)
if (dual_timestamp_is_set(&t->last_trigger))
b = t->last_trigger.realtime;
else {
if (state_translation_table[t->state] == UNIT_ACTIVE)
b = UNIT(t)->inactive_exit_timestamp.realtime;
else
b = ts.realtime;
}
else if (dual_timestamp_is_set(&UNIT(t)->inactive_exit_timestamp))
b = UNIT(t)->inactive_exit_timestamp.realtime;
else
b = ts.realtime;
r = calendar_spec_next_usec(v->calendar_spec, b, &v->next_elapse);
if (r < 0)