cgroups: don't change a freezer state if an operation failed

Signed-off-by: Andrey Vagin <avagin@openvz.org>
This commit is contained in:
Andrey Vagin 2015-01-14 19:39:29 +03:00
parent 1d3b2589d7
commit 13a5703d85
1 changed files with 7 additions and 3 deletions

View File

@ -124,11 +124,15 @@ func Freeze(c *cgroups.Cgroup, state cgroups.FreezerState) error {
return err
}
freezer := subsystems["freezer"]
err = freezer.Set(d)
if err != nil {
return err
}
c.Freezer = state
freezer := subsystems["freezer"]
return freezer.Set(d)
return nil
}
func GetPids(c *cgroups.Cgroup) ([]int, error) {