cgroup: make use of unit_cgroup_delegate() where useful

It's an easy-to-use wrapper, so let's take benefit of it.
This commit is contained in:
Lennart Poettering
2017-09-22 20:02:23 +02:00
parent 40853aa53f
commit 7960b0c704
+5 -9
View 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;
void unit_set_exec_params(Unit *u, ExecParameters *p) {
assert(u);
assert(p);
assert(s);
assert(s);
p->cgroup_path = s->cgroup_path;
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));
}