Skip to content

Commit 4994991

Browse files
authored
Merge pull request #79 from crosbymichael/load-none
Return ErrCgroupDeleted when no subsystems
2 parents dbea6f2 + 453efe3 commit 4994991

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cgroup.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,10 @@ func Load(hierarchy Hierarchy, path Path, opts ...InitOpts) (Cgroup, error) {
105105
}
106106
activeSubsystems = append(activeSubsystems, s)
107107
}
108+
// if we do not have any active systems then the cgroup is deleted
109+
if len(activeSubsystems) == 0 {
110+
return nil, ErrCgroupDeleted
111+
}
108112
return &cgroup{
109113
path: path,
110114
subsystems: activeSubsystems,

0 commit comments

Comments
 (0)