]> git.ipfire.org Git - thirdparty/systemd.git/commit
cgroup-util: drop handcrafted cg_is_empty(), always check cgroup.events populated...
authorMike Yuan <me@yhndnzj.com>
Mon, 26 May 2025 20:27:26 +0000 (22:27 +0200)
committerMike Yuan <me@yhndnzj.com>
Mon, 26 May 2025 20:59:48 +0000 (22:59 +0200)
commitc3f900770d0cff0cdf89751b614397b5e226194a
tree3f90fdf91caa0724299965b53bd73b0cd2a49edd
parent879952a85311ca375c673480d9718a9e0cd93c1d
cgroup-util: drop handcrafted cg_is_empty(), always check cgroup.events populated field

This effectively renames cg_is_empty_recursive() to cg_is_empty().
Note that all existing code calls the former and not the latter,
hence with cgv1 support being dropped it's trivial to consult
cgroup.events directly for populated state everywhere.

Additionally, use more generic cg_get_keyed_attribute() helper
rather than cg_read_event().
src/basic/cgroup-util.c
src/basic/cgroup-util.h
src/core/cgroup.c
src/core/service.c
src/login/loginctl.c
src/machine/machinectl.c
src/shared/cgroup-show.c
src/test/test-cgroup.c