X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fcore%2Ftimer.c;h=5c4e9f995a64888328728dfe86c4d8572ed3cc05;hb=0c2a5d721ece665618614d05049975ad84a9ee4a;hp=dc0f289c7afafc943e8d742ac88d4f1663a15fff;hpb=19f8d037833f2426f0ea6b06279d669ed69fcfd1;p=elogind.git diff --git a/src/core/timer.c b/src/core/timer.c index dc0f289c7..5c4e9f995 100644 --- a/src/core/timer.c +++ b/src/core/timer.c @@ -242,7 +242,7 @@ static void timer_dump(Unit *u, FILE *f, const char *prefix) { "%s%s: %s\n", prefix, timer_base_to_string(v->base), - strna(format_timespan(timespan1, sizeof(timespan1), v->value, 0))); + format_timespan(timespan1, sizeof(timespan1), v->value, 0)); } } } @@ -521,6 +521,7 @@ fail: static int timer_start(Unit *u) { Timer *t = TIMER(u); + TimerValue *v; assert(t); assert(t->state == TIMER_DEAD || t->state == TIMER_FAILED); @@ -530,6 +531,11 @@ static int timer_start(Unit *u) { t->last_trigger = DUAL_TIMESTAMP_NULL; + /* Reenable all timers that depend on unit activation time */ + LIST_FOREACH(value, v, t->values) + if (v->base == TIMER_ACTIVE) + v->disabled = false; + if (t->stamp_path) { struct stat st;