chiark / gitweb /
main: automatically spawn a getty on the kernel configured serial console
[elogind.git] / src / timer.c
index 1580478949595cd0a6006fd0360ad8103d497efc..cd6728a1864d880f0ad9661c456918b4cf42b749 100644 (file)
@@ -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
 };