summaryrefslogtreecommitdiff
path: root/timer.c
diff options
context:
space:
mode:
Diffstat (limited to 'timer.c')
-rw-r--r--timer.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/timer.c b/timer.c
index 29346204f8..c3ebba0d1b 100644
--- a/timer.c
+++ b/timer.c
@@ -1,5 +1,7 @@
/*-*- Mode: C; c-basic-offset: 8 -*-*/
+#include <errno.h>
+
#include "unit.h"
#include "timer.h"
@@ -9,6 +11,19 @@ static void timer_done(Unit *u) {
assert(t);
}
+static int timer_init(Unit *u) {
+ int r;
+
+ assert(u);
+
+ /* Make sure this config file actually exists */
+
+ if ((r = unit_load_fragment_and_dropin(u)) <= 0)
+ return r < 0 ? r : -ENOENT;
+
+ return 0;
+}
+
static UnitActiveState timer_active_state(Unit *u) {
static const UnitActiveState table[_TIMER_STATE_MAX] = {
@@ -23,7 +38,7 @@ static UnitActiveState timer_active_state(Unit *u) {
const UnitVTable timer_vtable = {
.suffix = ".timer",
- .init = unit_load_fragment_and_dropin,
+ .init = timer_init,
.done = timer_done,
.active_state = timer_active_state