]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
cgroup: make use of unit_cgroup_delegate() where useful
authorLennart Poettering <lennart@poettering.net>
Fri, 22 Sep 2017 18:02:23 +0000 (20:02 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 22 Sep 2017 18:02:23 +0000 (20:02 +0200)
It's an easy-to-use wrapper, so let's take benefit of it.

src/core/unit.c

index df89f3d01f1fc96281029e1975a9cf77985d8676..f1936bdf0b0b2dae09d5ed74ba62b027cd4e5f73 100644 (file)
@@ -4429,14 +4429,10 @@ int unit_acquire_invocation_id(Unit *u) {
         return 0;
 }
 
-void unit_set_exec_params(Unit *s, ExecParameters *p) {
-        CGroupContext *c;
-
-        assert(s);
-        assert(s);
-
-        p->cgroup_path = s->cgroup_path;
+void unit_set_exec_params(Unit *u, ExecParameters *p) {
+        assert(u);
+        assert(p);
 
-        c = unit_get_cgroup_context(s);
-        SET_FLAG(p->flags, EXEC_CGROUP_DELEGATE, c && c->delegate);
+        p->cgroup_path = u->cgroup_path;
+        SET_FLAG(p->flags, EXEC_CGROUP_DELEGATE, unit_cgroup_delegate(u));
 }