- r = cg_get_by_pid(SYSTEMD_CGROUP_CONTROLLER, 1, &root);
- if (r < 0)
- t = "/";
- else {
- if (endswith(root, "/system"))
- root[strlen(root)-7] = 0;
-
- t = root[0] ? root : "/";
+ r = cg_get_root_path(&root);
+ if (r < 0) {
+ log_error("Failed to get root path: %s", strerror(-r));
+ goto finish;