chiark / gitweb /
job: timeout every job independently of the unit
[elogind.git] / src / device.c
index dc626d8189777f035c31212f1f68237de19d755d..39ab29110374058a125e94d064f7991219cf91d0 100644 (file)
@@ -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,