From 7960b0c704f2b41705219ba36f0cd6f9a29cef99 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 22 Sep 2017 20:02:23 +0200 Subject: [PATCH] cgroup: make use of unit_cgroup_delegate() where useful It's an easy-to-use wrapper, so let's take benefit of it. --- src/core/unit.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/core/unit.c b/src/core/unit.c index df89f3d01f1..f1936bdf0b0 100644 --- a/src/core/unit.c +++ b/src/core/unit.c @@ -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)); } -- 2.47.3