Fix task load.

Signed-off-by: Lantao Liu <lantaol@google.com>
This commit is contained in:
Lantao Liu
2017-10-05 02:07:37 +00:00
parent 72a3a019ae
commit 28ca8f05d3
5 changed files with 25 additions and 7 deletions

View File

@@ -10,6 +10,7 @@ import (
"sync"
specs "github.com/opencontainers/runtime-spec/specs-go"
"github.com/pkg/errors"
)
// New returns a new control via the cgroup cgroups interface
@@ -39,6 +40,9 @@ func Load(hierarchy Hierarchy, path Path) (Cgroup, error) {
for _, s := range pathers(subsystems) {
p, err := path(s.Name())
if err != nil {
if os.IsNotExist(errors.Cause(err)) {
return nil, ErrCgroupDeleted
}
return nil, err
}
if _, err := os.Lstat(s.Path(p)); err != nil {