Merge pull request #338 from avagin/fixes

cgroups: set a freezer state before calling FreezerGroup.Set()
This commit is contained in:
Mrunal Patel 2015-01-19 09:33:08 -08:00
commit eb74393a3d
1 changed files with 4 additions and 2 deletions

View File

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