return b;
}
-int enter_cgroup_subroot(void) {
+int enter_cgroup_subroot(char **ret_cgroup) {
_cleanup_free_ char *cgroup_root = NULL, *cgroup_subroot = NULL;
CGroupMask supported;
int r;
if (r < 0)
return r;
- return cg_attach_everywhere(supported, cgroup_subroot, 0, NULL, NULL);
+ r = cg_attach_everywhere(supported, cgroup_subroot, 0, NULL, NULL);
+ if (r < 0)
+ return r;
+
+ if (ret_cgroup)
+ *ret_cgroup = TAKE_PTR(cgroup_subroot);
+ return 0;
}
}
char* setup_fake_runtime_dir(void);
-int enter_cgroup_subroot(void);
+int enter_cgroup_subroot(char **ret_cgroup);
const char* get_testdata_dir(void);
const char* get_catalog_dir(void);
bool slow_tests_enabled(void);
if (!can_memlock())
return log_tests_skipped("Can't use mlock(), skipping.");
- r = enter_cgroup_subroot();
+ r = enter_cgroup_subroot(NULL);
if (r == -ENOMEDIUM)
return log_tests_skipped("cgroupfs not available");
int r;
CGroupMask cpu_accounting_mask = get_cpu_accounting_mask();
- r = enter_cgroup_subroot();
+ r = enter_cgroup_subroot(NULL);
if (r == -ENOMEDIUM)
return log_tests_skipped("cgroupfs not available");
uint64_t dml_tree_default;
int r;
- r = enter_cgroup_subroot();
+ r = enter_cgroup_subroot(NULL);
if (r == -ENOMEDIUM)
return log_tests_skipped("cgroupfs not available");
test_setup_logging(LOG_DEBUG);
- r = enter_cgroup_subroot();
+ r = enter_cgroup_subroot(NULL);
if (r == -ENOMEDIUM)
return log_tests_skipped("cgroupfs not available");
if (getuid() != 0)
return log_tests_skipped("not root");
- r = enter_cgroup_subroot();
+ r = enter_cgroup_subroot(NULL);
if (r == -ENOMEDIUM)
return log_tests_skipped("cgroupfs not available");
test_setup_logging(LOG_INFO);
- r = enter_cgroup_subroot();
+ r = enter_cgroup_subroot(NULL);
if (r == -ENOMEDIUM)
return log_tests_skipped("cgroupfs not available");
assert_se(m);
- r = enter_cgroup_subroot();
+ r = enter_cgroup_subroot(NULL);
if (r == -ENOMEDIUM)
return log_tests_skipped("cgroupfs not available");
test_setup_logging(LOG_INFO);
- r = enter_cgroup_subroot();
+ r = enter_cgroup_subroot(NULL);
if (r == -ENOMEDIUM)
return log_tests_skipped("cgroupfs not available");
test_setup_logging(LOG_INFO);
- r = enter_cgroup_subroot();
+ r = enter_cgroup_subroot(NULL);
if (r == -ENOMEDIUM)
return log_tests_skipped("cgroupfs not available");
if (getuid() != 0)
return log_tests_skipped("not root");
- r = enter_cgroup_subroot();
+ r = enter_cgroup_subroot(NULL);
if (r == -ENOMEDIUM)
return log_tests_skipped("cgroupfs not available");