chiark / gitweb /
fix off by one error in array index assertion
[elogind.git] / src / core / scope.c
index 940e40dda78076d575bea7abf9496894ee00df02..be2a6370239f0762c327dcb6606100602c019d05 100644 (file)
@@ -54,6 +54,8 @@ static void scope_init(Unit *u) {
         cgroup_context_init(&s->cgroup_context);
         kill_context_init(&s->kill_context);
 
+        unit_cgroup_context_init_defaults(u, &s->cgroup_context);
+
         UNIT(s)->ignore_on_isolate = true;
         UNIT(s)->ignore_on_snapshot = true;
 }
@@ -88,7 +90,7 @@ static int scope_arm_timer(Scope *s) {
                 return sd_event_source_set_enabled(s->timer_event_source, SD_EVENT_ONESHOT);
         }
 
-        return sd_event_add_monotonic(UNIT(s)->manager->event, now(CLOCK_MONOTONIC) + s->timeout_stop_usec, 0, scope_dispatch_timer, s, &s->timer_event_source);
+        return sd_event_add_monotonic(UNIT(s)->manager->event, &s->timer_event_source, now(CLOCK_MONOTONIC) + s->timeout_stop_usec, 0, scope_dispatch_timer, s);
 }
 
 static void scope_set_state(Scope *s, ScopeState state) {