Skip to content

Commit 751ce28

Browse files
authored
Merge pull request #373 from fuweid/weifu/use-close-on-exec
2 parents d75e8b8 + 31280a1 commit 751ce28

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cgroup2/manager.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,7 @@ func (c *Manager) isCgroupEmpty() bool {
745745
// MemoryEventFD returns inotify file descriptor and 'memory.events' inotify watch descriptor
746746
func (c *Manager) MemoryEventFD() (int, uint32, error) {
747747
fpath := filepath.Join(c.path, "memory.events")
748-
fd, err := unix.InotifyInit()
748+
fd, err := unix.InotifyInit1(unix.IN_CLOEXEC)
749749
if err != nil {
750750
return 0, 0, fmt.Errorf("failed to create inotify fd: %w", err)
751751
}

0 commit comments

Comments
 (0)