basic/cgroup-util: let cgroup_unified_flush() return the detected hierarchy
This avoid the use of the global variable. Also rename cgroup_unified_update() to cgroup_unified_cached() and cgroup_unified_flush() to cgroup_unified() to better reflect their new roles.
This commit is contained in:
@@ -385,12 +385,12 @@ static void test_is_wanted(void) {
|
||||
static void test_cg_tests(void) {
|
||||
int all, hybrid, systemd, r;
|
||||
|
||||
r = cg_unified_flush();
|
||||
r = cg_unified();
|
||||
if (r == -ENOMEDIUM) {
|
||||
log_notice_errno(r, "Skipping cg hierarchy tests: %m");
|
||||
return;
|
||||
}
|
||||
assert_se(r == 0);
|
||||
assert_se(r >= 0);
|
||||
|
||||
all = cg_all_unified();
|
||||
assert_se(IN_SET(all, 0, 1));
|
||||
|
||||
@@ -124,7 +124,7 @@ static void test_condition_test_control_group_controller(void) {
|
||||
_cleanup_free_ char *controller_name = NULL;
|
||||
int r;
|
||||
|
||||
r = cg_unified_flush();
|
||||
r = cg_unified();
|
||||
if (r < 0) {
|
||||
log_notice_errno(r, "Skipping ConditionControlGroupController tests: %m");
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user