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
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
prevState := c.Freezer
|
||||||
|
c.Freezer = state
|
||||||
|
|
||||||
freezer := subsystems["freezer"]
|
freezer := subsystems["freezer"]
|
||||||
err = freezer.Set(d)
|
err = freezer.Set(d)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
c.Freezer = prevState
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
c.Freezer = state
|
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue