From: Mike Yuan Date: Mon, 26 May 2025 20:46:17 +0000 (+0200) Subject: core/cgroup: CGRuntime.cgroup_path indicates whether the cg is still alive X-Git-Tag: v258-rc1~483^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=879952a85311ca375c673480d9718a9e0cd93c1d;p=thirdparty%2Fsystemd.git core/cgroup: CGRuntime.cgroup_path indicates whether the cg is still alive so drop redundant checks in attr getters. Memory and IO accounting functions already follow this pattern. --- diff --git a/src/core/cgroup.c b/src/core/cgroup.c index ed5d0f975dd..61ac5b6f449 100644 --- a/src/core/cgroup.c +++ b/src/core/cgroup.c @@ -3626,8 +3626,6 @@ static int unit_get_cpu_usage_raw(const Unit *u, const CGroupRuntime *crt, nsec_ uint64_t us; r = cg_get_keyed_attribute("cpu", crt->cgroup_path, "cpu.stat", STRV_MAKE("usage_usec"), &val); - if (IN_SET(r, -ENOENT, -ENXIO)) - return -ENODATA; if (r < 0) return r; @@ -4082,8 +4080,6 @@ static int unit_cgroup_freezer_kernel_state(Unit *u, FreezerState *ret) { "cgroup.events", STRV_MAKE("frozen"), &val); - if (IN_SET(r, -ENOENT, -ENXIO)) - return -ENODATA; if (r < 0) return r;