- if ((r = cgroup_init()) != 0) {
- log_error("Failed to initialize libcg: %s", cgroup_strerror(r));
- return cg_translate_error(r, errno);
- }
-
- free(m->cgroup_mount_point);
- m->cgroup_mount_point = NULL;
- if ((r = cgroup_get_subsys_mount_point(SYSTEMD_CGROUP_CONTROLLER, &m->cgroup_mount_point)))
- return cg_translate_error(r, errno);
-
- pid = getpid();
+ /* 1. Determine hierarchy */
+ if ((r = cg_get_by_pid(SYSTEMD_CGROUP_CONTROLLER, 0, ¤t)) < 0)
+ goto finish;