-/*-*- Mode: C; c-basic-offset: 8 -*-*/
+/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
/***
This file is part of systemd.
[TIMER_WAITING] = UNIT_ACTIVE,
[TIMER_RUNNING] = UNIT_ACTIVE,
[TIMER_ELAPSED] = UNIT_ACTIVE,
- [TIMER_MAINTENANCE] = UNIT_MAINTENANCE
+ [TIMER_FAILED] = UNIT_FAILED
};
static void timer_init(Unit *u) {
if (!success)
t->failure = true;
- timer_set_state(t, t->failure ? TIMER_MAINTENANCE : TIMER_DEAD);
+ timer_set_state(t, t->failure ? TIMER_FAILED : TIMER_DEAD);
}
static void timer_enter_waiting(Timer *t, bool initial) {
Timer *t = TIMER(u);
assert(t);
- assert(t->state == TIMER_DEAD || t->state == TIMER_MAINTENANCE);
+ assert(t->state == TIMER_DEAD || t->state == TIMER_FAILED);
if (t->unit->meta.load_state != UNIT_LOADED)
return -ENOENT;
case TIMER_RUNNING:
- if (UNIT_IS_INACTIVE_OR_MAINTENANCE(new_state)) {
+ if (UNIT_IS_INACTIVE_OR_FAILED(new_state)) {
log_debug("%s got notified about unit deactivation.", t->meta.id);
timer_enter_waiting(t, false);
}
break;
case TIMER_DEAD:
- case TIMER_MAINTENANCE:
- ;
+ case TIMER_FAILED:
+ break;
default:
assert_not_reached("Unknown timer state");
log_error("Failed find timer unit: %s", strerror(-r));
}
-static void timer_reset_maintenance(Unit *u) {
+static void timer_reset_failed(Unit *u) {
Timer *t = TIMER(u);
assert(t);
- if (t->state == TIMER_MAINTENANCE)
+ if (t->state == TIMER_FAILED)
timer_set_state(t, TIMER_DEAD);
t->failure = false;
[TIMER_WAITING] = "waiting",
[TIMER_RUNNING] = "running",
[TIMER_ELAPSED] = "elapsed",
- [TIMER_MAINTENANCE] = "maintenance"
+ [TIMER_FAILED] = "failed"
};
DEFINE_STRING_TABLE_LOOKUP(timer_state, TimerState);
.timer_event = timer_timer_event,
- .reset_maintenance = timer_reset_maintenance,
+ .reset_failed = timer_reset_failed,
- .bus_message_handler = bus_timer_message_handler
+ .bus_interface = "org.freedesktop.systemd1.Timer",
+ .bus_message_handler = bus_timer_message_handler,
+ .bus_invalidating_properties = bus_timer_invalidating_properties
};