]> git.ipfire.org Git - thirdparty/systemd.git/commit
core: add cg_path_get_unit_path()
authorQuentin Deslandes <qde@naccy.de>
Thu, 26 Jan 2023 18:39:08 +0000 (19:39 +0100)
committerQuentin Deslandes <qde@naccy.de>
Wed, 8 Feb 2023 15:48:58 +0000 (16:48 +0100)
commitee164216d38bc7ca51e040b90bdc96ed7518df37
tree590008b2c2b6d1aee69617b92df91926bf002442
parent9779079b5354ac66809a1b6e593ef2a2a3f75117
core: add cg_path_get_unit_path()

From a given cgroup path, cg_path_get_unit() allows to retrieve the
unit's name. Although, this removes the path to the unit's cgroup,
preventing the result to be used to fetch xattrs.

Introduce cg_path_get_unit_path() which provides the path to the unit's
cgroup. This function behave similarly to cg_path_get_unit() (checking
the validity and escaping the unit's name).
src/basic/cgroup-util.c
src/basic/cgroup-util.h
src/test/test-cgroup-util.c