]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core/cgroup: fix return value of unit_cgorup_freezer_action()
authorMichal Sekletar <msekleta@redhat.com>
Thu, 7 May 2020 15:23:30 +0000 (17:23 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 7 May 2020 20:19:19 +0000 (22:19 +0200)
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.

src/core/cgroup.c

index 56598d3baad77c4cc54361724d7df4559d00c4a4..7d45438e85a116aede08dc98e103e6c1e4daa48e 100644 (file)
@@ -3634,7 +3634,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] = {