Merge pull request #335 from avagin/fixes

cgroups: don't change a freezer state if an operation failed
This commit is contained in:
Victor Marmol 2015-01-15 08:25:10 -08:00
commit 29ba9b3179
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 return err
} }
freezer := subsystems["freezer"]
err = freezer.Set(d)
if err != nil {
return err
}
c.Freezer = state c.Freezer = state
freezer := subsystems["freezer"] return nil
return freezer.Set(d)
} }
func GetPids(c *cgroups.Cgroup) ([]int, error) { func GetPids(c *cgroups.Cgroup) ([]int, error) {