]> go.fuhry.dev Git - fsnotify.git/commitdiff
Open files with CLOEXEC
authorEric Lin <linxiulei@gmail.com>
Thu, 25 Oct 2018 04:24:55 +0000 (12:24 +0800)
committerNathan Youngman <4566+nathany@users.noreply.github.com>
Sat, 5 Oct 2019 22:01:05 +0000 (16:01 -0600)
Fix #272

open_mode_bsd.go
open_mode_darwin.go

index 7d8de14513ede1cbd55a6d4493c1eafc550e0a42..2306c4620bf6dbd40e6d9eecfbc36f5d3bebea1b 100644 (file)
@@ -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
index 9139e17161bfb3796999fb0474846d14f3b7da0f..870c4d6d184509ae6c94d4db99028146029cf4c6 100644 (file)
@@ -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