cgroups: simplify the join_memory check

If c.Memory=0, there is no point to set memoryswap.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
This commit is contained in:
Qiang Huang 2015-01-22 12:19:40 +08:00
parent c4821b6f3e
commit 46573774a2
1 changed files with 1 additions and 1 deletions

View File

@ -133,7 +133,7 @@ func Apply(c *cgroups.Cgroup, pid int) (map[string]string, error) {
}
// -1 disables memorySwap
if c.MemorySwap >= 0 && (c.Memory != 0 || c.MemorySwap > 0) {
if c.MemorySwap >= 0 && c.Memory != 0 {
if err := joinMemory(c, pid); err != nil {
return nil, err
}