summaryrefslogtreecommitdiff
path: root/src/timer.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-07-18 04:58:01 +0200
committerLennart Poettering <lennart@poettering.net>2010-07-19 04:08:07 +0200
commit5632e3743db350a67478acc107d76cdf648a1f99 (patch)
treee7efad268223470ca3053db650a2c7b3ad9c90c4 /src/timer.c
parentb9975629f03a43d4c6b14fdb42eb8dd5a30af28f (diff)
systemctl: introduce reset-maintenance command
Diffstat (limited to 'src/timer.c')
-rw-r--r--src/timer.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/timer.c b/src/timer.c
index 1580478949..cd6728a186 100644
--- a/src/timer.c
+++ b/src/timer.c
@@ -450,6 +450,17 @@ fail:
log_error("Failed find timer unit: %s", strerror(-r));
}
+static void timer_reset_maintenance(Unit *u) {
+ Timer *t = TIMER(u);
+
+ assert(t);
+
+ if (t->state == TIMER_MAINTENANCE)
+ timer_set_state(t, TIMER_DEAD);
+
+ t->failure = false;
+}
+
static const char* const timer_state_table[_TIMER_STATE_MAX] = {
[TIMER_DEAD] = "dead",
[TIMER_WAITING] = "waiting",
@@ -492,5 +503,7 @@ const UnitVTable timer_vtable = {
.timer_event = timer_timer_event,
+ .reset_maintenance = timer_reset_maintenance,
+
.bus_message_handler = bus_timer_message_handler
};