X Tutup
Skip to content

Commit 5dd2f5f

Browse files
committed
core: do not setup/teardown cgroup if MANAGER_TEST_RUN_MINIMAL is set as a flag
Rather than checking if test_run_flags is set exclusively to MANAGER_TEST_RUN_MINIMAL, check if it is set as a flag, so that it can be used together with other flags.
1 parent 24c006d commit 5dd2f5f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/core/cgroup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3303,7 +3303,7 @@ void manager_shutdown_cgroup(Manager *m, bool delete) {
33033303

33043304
/* We can't really delete the group, since we are in it. But
33053305
* let's trim it. */
3306-
if (delete && m->cgroup_root && m->test_run_flags != MANAGER_TEST_RUN_MINIMAL)
3306+
if (delete && m->cgroup_root && !FLAGS_SET(m->test_run_flags, MANAGER_TEST_RUN_MINIMAL))
33073307
(void) cg_trim(SYSTEMD_CGROUP_CONTROLLER, m->cgroup_root, false);
33083308

33093309
m->cgroup_empty_event_source = sd_event_source_unref(m->cgroup_empty_event_source);

src/core/manager.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -870,7 +870,7 @@ int manager_new(UnitFileScope scope, ManagerTestRunFlags test_run_flags, Manager
870870
if (r < 0)
871871
return r;
872872

873-
if (test_run_flags == MANAGER_TEST_RUN_MINIMAL) {
873+
if (FLAGS_SET(test_run_flags, MANAGER_TEST_RUN_MINIMAL)) {
874874
m->cgroup_root = strdup("");
875875
if (!m->cgroup_root)
876876
return -ENOMEM;

0 commit comments

Comments
 (0)
X Tutup