X Tutup
Skip to content

Commit dd37657

Browse files
authored
Merge pull request systemd#20080 from bluca/core_flag
analyze: do not attempt to set up cgroups while verifying units
2 parents cc03890 + a381a9d commit dd37657

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/analyze/analyze-verify.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ static int verify_unit(Unit *u, bool check_man) {
220220

221221
int verify_units(char **filenames, UnitFileScope scope, bool check_man, bool run_generators) {
222222
const ManagerTestRunFlags flags =
223-
MANAGER_TEST_RUN_BASIC |
223+
MANAGER_TEST_RUN_MINIMAL |
224224
MANAGER_TEST_RUN_ENV_GENERATORS |
225225
run_generators * MANAGER_TEST_RUN_GENERATORS;
226226

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_disable_unref(m->cgroup_empty_event_source);

src/core/manager.c

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

880-
if (test_run_flags == MANAGER_TEST_RUN_MINIMAL) {
880+
if (FLAGS_SET(test_run_flags, MANAGER_TEST_RUN_MINIMAL)) {
881881
m->cgroup_root = strdup("");
882882
if (!m->cgroup_root)
883883
return -ENOMEM;

0 commit comments

Comments
 (0)
X Tutup