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:
Zbigniew Jędrzejewski-Szmek
2019-09-16 18:06:20 +02:00
parent 5a1c1b534f
commit d4d99bc6e4
7 changed files with 38 additions and 40 deletions
+2 -2
View File
@@ -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));
+1 -1
View File
@@ -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;