summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Sekletar <msekleta@redhat.com>2020-05-07 17:23:30 +0200
committerThe Plumber <50238977+systemd-rhel-bot@users.noreply.github.com>2020-06-23 14:50:50 +0200
commitabf2fb67dc3d7da8db030ea8b8db73a20acc08a9 (patch)
tree3028c506af202ef60d046dadfd12f1381de16491
parent046ea98539eb8d7cef93d8062035fa6d9f58efea (diff)
downloadsystemd-abf2fb67dc3d7da8db030ea8b8db73a20acc08a9.tar.gz
core/cgroup: fix return value of unit_cgorup_freezer_action()
We should return 0 only if current freezer state, as reported by the kernel, is already the desired state. Otherwise, we would dispatch return dbus message prematurely in bus_unit_method_freezer_generic(). Thanks to Frantisek Sumsal for reporting the issue. (cherry picked from commit d910f4c2b2542544d7b187a09605da7a0f220837) Related: #1830861
-rw-r--r--src/core/cgroup.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/cgroup.c b/src/core/cgroup.c
index e7ae9273a6..2d819b8ebb 100644
--- a/src/core/cgroup.c
+++ b/src/core/cgroup.c
@@ -2963,7 +2963,7 @@ int unit_cgroup_freezer_action(Unit *u, FreezerAction action) {
if (r < 0)
return r;
- return 0;
+ return 1;
}
static const char* const cgroup_device_policy_table[_CGROUP_DEVICE_POLICY_MAX] = {