mirror of
https://github.com/systemd/systemd.git
synced 2024-11-01 00:51:24 +03:00
Merge pull request #20080 from bluca/core_flag
analyze: do not attempt to set up cgroups while verifying units
This commit is contained in:
commit
dd376574fd
@ -220,7 +220,7 @@ static int verify_unit(Unit *u, bool check_man) {
|
||||
|
||||
int verify_units(char **filenames, UnitFileScope scope, bool check_man, bool run_generators) {
|
||||
const ManagerTestRunFlags flags =
|
||||
MANAGER_TEST_RUN_BASIC |
|
||||
MANAGER_TEST_RUN_MINIMAL |
|
||||
MANAGER_TEST_RUN_ENV_GENERATORS |
|
||||
run_generators * MANAGER_TEST_RUN_GENERATORS;
|
||||
|
||||
|
@ -3303,7 +3303,7 @@ void manager_shutdown_cgroup(Manager *m, bool delete) {
|
||||
|
||||
/* We can't really delete the group, since we are in it. But
|
||||
* let's trim it. */
|
||||
if (delete && m->cgroup_root && m->test_run_flags != MANAGER_TEST_RUN_MINIMAL)
|
||||
if (delete && m->cgroup_root && !FLAGS_SET(m->test_run_flags, MANAGER_TEST_RUN_MINIMAL))
|
||||
(void) cg_trim(SYSTEMD_CGROUP_CONTROLLER, m->cgroup_root, false);
|
||||
|
||||
m->cgroup_empty_event_source = sd_event_source_disable_unref(m->cgroup_empty_event_source);
|
||||
|
@ -877,7 +877,7 @@ int manager_new(UnitFileScope scope, ManagerTestRunFlags test_run_flags, Manager
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
if (test_run_flags == MANAGER_TEST_RUN_MINIMAL) {
|
||||
if (FLAGS_SET(test_run_flags, MANAGER_TEST_RUN_MINIMAL)) {
|
||||
m->cgroup_root = strdup("");
|
||||
if (!m->cgroup_root)
|
||||
return -ENOMEM;
|
||||
|
Loading…
Reference in New Issue
Block a user