summaryrefslogtreecommitdiff
path: root/src/device.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-07-17 04:09:28 +0200
committerLennart Poettering <lennart@poettering.net>2010-07-17 04:09:28 +0200
commitfaf919f1ebebdfc13f769bb6585e64e7ad4b301b (patch)
tree8fb54ae1edeffef63cf72fb40b278b57cb727e18 /src/device.c
parent064f51fa29c1dfd7c0704feb969eb59119e57854 (diff)
job: timeout every job independently of the unit
Diffstat (limited to 'src/device.c')
-rw-r--r--src/device.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/device.c b/src/device.c
index dc626d8189..39ab291103 100644
--- a/src/device.c
+++ b/src/device.c
@@ -35,6 +35,15 @@ static const UnitActiveState state_translation_table[_DEVICE_STATE_MAX] = {
[DEVICE_PLUGGED] = UNIT_ACTIVE
};
+static void device_init(Unit *u) {
+ Device *d = DEVICE(u);
+
+ assert(d);
+ assert(d->meta.load_state == UNIT_STUB);
+
+ d->meta.job_timeout = DEFAULT_TIMEOUT_USEC;
+}
+
static void device_done(Unit *u) {
Device *d = DEVICE(u);
@@ -456,6 +465,8 @@ const UnitVTable device_vtable = {
.no_snapshots = true,
.no_isolate = true,
+ .init = device_init,
+
.load = unit_load_fragment_and_dropin_optional,
.done = device_done,
.coldplug = device_coldplug,