From 11054bcfedcc693de29270308bda9b4230791742 Mon Sep 17 00:00:00 2001 From: Patrick Date: Mon, 10 Oct 2016 19:24:00 -0700 Subject: [PATCH] Create inotify fd with close-on-exec (#178) * Create inotify fd with close-on-exec * switch to unix.IN_CLOEXEC --- inotify.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inotify.go b/inotify.go index 9700df5..f3b74c5 100644 --- a/inotify.go +++ b/inotify.go @@ -36,7 +36,7 @@ type Watcher struct { // NewWatcher establishes a new watcher with the underlying OS and begins waiting for events. func NewWatcher() (*Watcher, error) { // Create inotify fd - fd, errno := unix.InotifyInit() + fd, errno := unix.InotifyInit1(unix.IN_CLOEXEC) if fd == -1 { return nil, errno } -- 2.50.1