Merge pull request #338 from avagin/fixes
cgroups: set a freezer state before calling FreezerGroup.Set()
This commit is contained in:
commit
eb74393a3d
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue