diff --git a/src/core/timer.c b/src/core/timer.c index 419416b3255..aab376e5cc7 100644 --- a/src/core/timer.c +++ b/src/core/timer.c @@ -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)