From: Yu Watanabe Date: Fri, 6 May 2022 05:01:22 +0000 (+0900) Subject: core/slice: make slice_freezer_action() return 0 if freezing state is unchanged X-Git-Tag: v251-rc3~32 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d171e72e7afa11b238ba20758384d223b0c76e39;p=thirdparty%2Fsystemd.git core/slice: make slice_freezer_action() return 0 if freezing state is unchanged Fixes #23278. --- diff --git a/src/core/slice.c b/src/core/slice.c index 2e43c001190..c453aa033e7 100644 --- a/src/core/slice.c +++ b/src/core/slice.c @@ -389,11 +389,7 @@ static int slice_freezer_action(Unit *s, FreezerAction action) { return r; } - r = unit_cgroup_freezer_action(s, action); - if (r < 0) - return r; - - return 1; + return unit_cgroup_freezer_action(s, action); } static int slice_freeze(Unit *s) { diff --git a/src/core/unit.c b/src/core/unit.c index fcfc9bc8d2b..b0756bc6f43 100644 --- a/src/core/unit.c +++ b/src/core/unit.c @@ -5849,6 +5849,8 @@ static int unit_freezer_action(Unit *u, FreezerAction action) { if (r <= 0) return r; + assert(IN_SET(u->freezer_state, FREEZER_FREEZING, FREEZER_THAWING)); + return 1; }