From 5632e3743db350a67478acc107d76cdf648a1f99 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sun, 18 Jul 2010 04:58:01 +0200 Subject: systemctl: introduce reset-maintenance command --- src/timer.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/timer.c') 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 }; -- cgit v1.2.3-54-g00ecf