tree-wide: replace cg_get_path_and_check() with cg_get_path()

We have dropped cgroup v1 support in v258. When running on cgroup v2,
cg_get_path_and_check() with SYSTEMD_CGROUP_CONTROLLER as controller is
equivalent with checking if we are running on cgroup v2 and then
cg_get_path(). As we can assume we are running on cgroup v2, then the
check is not necessary anymore, thus we can replace
cg_get_path_and_check() with cg_get_path().
This commit is contained in:
Yu Watanabe
2025-11-17 21:30:29 +09:00
parent b525a72f7b
commit 0ab90015e0
4 changed files with 3 additions and 35 deletions
+1 -5
View File
@@ -2146,11 +2146,7 @@ int posix_spawn_wrapper(
if (cgroup && have_clone_into_cgroup) {
_cleanup_free_ char *resolved_cgroup = NULL;
r = cg_get_path_and_check(
SYSTEMD_CGROUP_CONTROLLER,
cgroup,
/* suffix= */ NULL,
&resolved_cgroup);
r = cg_get_path(SYSTEMD_CGROUP_CONTROLLER, cgroup, /* suffix= */ NULL, &resolved_cgroup);
if (r < 0)
return r;