diff options
author | Mike Yuan <me@yhndnzj.com> | 2024-05-31 14:46:16 +0200 |
---|---|---|
committer | Mike Yuan <me@yhndnzj.com> | 2024-07-17 18:14:32 +0200 |
commit | 0064290a54fe46047889d44b3215d04b60e77c17 (patch) | |
tree | 11db45a8c8ba0d7df145358075ba8b61219d754d /src/core/cgroup.c | |
parent | core/cgroup: skip freezer action wholly if current == objective (diff) | |
download | systemd-0064290a54fe46047889d44b3215d04b60e77c17.tar.xz systemd-0064290a54fe46047889d44b3215d04b60e77c17.zip |
core/unit: introduce unit_set_freezer_state, make logging consistent
Also, emit PropertiesChanged signal for FreezerState too.
Fixes #31115
Diffstat (limited to 'src/core/cgroup.c')
-rw-r--r-- | src/core/cgroup.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/core/cgroup.c b/src/core/cgroup.c index a8bdd0dd0d..98f33fe580 100644 --- a/src/core/cgroup.c +++ b/src/core/cgroup.c @@ -5156,19 +5156,15 @@ int unit_cgroup_freezer_action(Unit *u, FreezerAction action) { if (r < 0) return r; - log_unit_debug(u, "Unit freezer state was %s, now %s.", - freezer_state_to_string(u->freezer_state), - freezer_state_to_string(next)); - r = write_string_file(path, one_zero(objective == FREEZER_FROZEN), WRITE_STRING_FILE_DISABLE_BUFFER); if (r < 0) return r; - u->freezer_state = next; + unit_set_freezer_state(u, next); return 1; /* Wait for cgroup event before replying */ skip: - u->freezer_state = freezer_state_finish(next); + unit_set_freezer_state(u, freezer_state_finish(next)); return 0; } |