From: Eric Lin Date: Thu, 25 Oct 2018 04:24:55 +0000 (+0800) Subject: Open files with CLOEXEC X-Git-Tag: v1.7.2~159 X-Git-Url: https://go.fuhry.dev/?a=commitdiff_plain;h=924410f0f293bf12ab5bc270f535f690346d53d6;p=fsnotify.git Open files with CLOEXEC Fix #272 --- diff --git a/open_mode_bsd.go b/open_mode_bsd.go index 7d8de14..2306c46 100644 --- a/open_mode_bsd.go +++ b/open_mode_bsd.go @@ -8,4 +8,4 @@ package fsnotify import "golang.org/x/sys/unix" -const openMode = unix.O_NONBLOCK | unix.O_RDONLY +const openMode = unix.O_NONBLOCK | unix.O_RDONLY | unix.O_CLOEXEC diff --git a/open_mode_darwin.go b/open_mode_darwin.go index 9139e17..870c4d6 100644 --- a/open_mode_darwin.go +++ b/open_mode_darwin.go @@ -9,4 +9,4 @@ package fsnotify import "golang.org/x/sys/unix" // note: this constant is not defined on BSD -const openMode = unix.O_EVTONLY +const openMode = unix.O_EVTONLY | unix.O_CLOEXEC