1 /*-*- Mode: C; c-basic-offset: 8 -*-*/
8 static void timer_done(Unit *u) {
14 static int timer_init(Unit *u) {
19 /* Make sure this config file actually exists */
21 if ((r = unit_load_fragment_and_dropin(u)) <= 0)
22 return r < 0 ? r : -ENOENT;
27 static UnitActiveState timer_active_state(Unit *u) {
29 static const UnitActiveState table[_TIMER_STATE_MAX] = {
30 [TIMER_DEAD] = UNIT_INACTIVE,
31 [TIMER_WAITING] = UNIT_ACTIVE,
32 [TIMER_RUNNING] = UNIT_ACTIVE
35 return table[TIMER(u)->state];
38 const UnitVTable timer_vtable = {
44 .active_state = timer_active_state