summaryrefslogtreecommitdiff
path: root/src/core/cgroup.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/cgroup.c')
-rw-r--r--src/core/cgroup.c31
1 files changed, 1 insertions, 30 deletions
diff --git a/src/core/cgroup.c b/src/core/cgroup.c
index b1e22e0ac3..e07d1ed3c9 100644
--- a/src/core/cgroup.c
+++ b/src/core/cgroup.c
@@ -373,7 +373,7 @@ int manager_setup_cgroup(Manager *m) {
log_debug("Created root group.");
- manager_shorten_default_controllers(m);
+ cg_shorten_controllers(m->default_controllers);
finish:
free(current);
@@ -397,35 +397,6 @@ void manager_shutdown_cgroup(Manager *m, bool delete) {
m->cgroup_hierarchy = NULL;
}
-void manager_shorten_default_controllers(Manager *m) {
- char **f, **t;
-
- strv_uniq(m->default_controllers);
-
- if (!m->default_controllers)
- return;
-
- for (f = m->default_controllers, t = m->default_controllers; *f; f++) {
-
- if (!streq(*f, "systemd") && !streq(*f, "name=systemd")) {
- char *cc;
-
- cc = alloca(sizeof("/sys/fs/cgroup/") + strlen(*f));
- strcpy(stpcpy(cc, "/sys/fs/cgroup/"), *f);
-
- if (access(cc, F_OK) >= 0) {
- *(t++) = *f;
- continue;
- }
- }
-
- log_debug("Controller %s not available or redundant, removing from default controllers list.", *f);
- free(*f);
- }
-
- *t = NULL;
-}
-
int cgroup_bonding_get(Manager *m, const char *cgroup, CGroupBonding **bonding) {
CGroupBonding *b;
char *p;