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 committed by Andrew Vagin
parent 083d91f8c3
commit 4eaff5e14e
1 changed files with 7 additions and 3 deletions

View File

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