summaryrefslogtreecommitdiff
path: root/src/timer.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-05-24 05:25:33 +0200
committerLennart Poettering <lennart@poettering.net>2010-05-24 05:25:33 +0200
commit01f78473b104d28db0fa813414092bc6358ae521 (patch)
treedbc1a63d818c7420ee2a50cbd205ae90b0c7185d /src/timer.c
parent871d7de47c13ee6cd78b8eefdf9128be3c740ac0 (diff)
path: add .path unit type for monitoring files
Diffstat (limited to 'src/timer.c')
-rw-r--r--src/timer.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/timer.c b/src/timer.c
index e95b4d66e1..b025051f2b 100644
--- a/src/timer.c
+++ b/src/timer.c
@@ -41,7 +41,6 @@ static void timer_init(Unit *u) {
assert(u->meta.load_state == UNIT_STUB);
t->next_elapse = (usec_t) -1;
- t->timer_watch.type = WATCH_INVALID;
}
static void timer_done(Unit *u) {
@@ -274,8 +273,12 @@ static int timer_start(Unit *u) {
Timer *t = TIMER(u);
assert(t);
- assert(t->state == TIMER_DEAD);
+ assert(t->state == TIMER_DEAD || t->state == TIMER_MAINTAINANCE);
+
+ if (t->unit->meta.load_state != UNIT_LOADED)
+ return -ENOENT;
+ t->failure = false;
timer_enter_waiting(t, true);
return 0;
}
@@ -373,9 +376,12 @@ void timer_unit_notify(Unit *u, UnitActiveState new_state) {
if (!p)
continue;
+ if (p->meta.load_state != UNIT_LOADED)
+ continue;
+
t = TIMER(p);
- if (t->meta.load_state != UNIT_LOADED)
+ if (t->unit != u)
continue;
/* Reenable all timers that depend on unit state */