summaryrefslogtreecommitdiffstats
path: root/src/core/cgroup.c
diff options
context:
space:
mode:
authorMike Yuan <me@yhndnzj.com>2024-05-31 14:46:16 +0200
committerMike Yuan <me@yhndnzj.com>2024-07-17 18:14:32 +0200
commit0064290a54fe46047889d44b3215d04b60e77c17 (patch)
tree11db45a8c8ba0d7df145358075ba8b61219d754d /src/core/cgroup.c
parentcore/cgroup: skip freezer action wholly if current == objective (diff)
downloadsystemd-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.c8
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;
}