Skip to content

Commit 924410f

Browse files
linxiuleinathany
authored andcommitted
Open files with CLOEXEC
Fix fsnotify#272
1 parent 1485a34 commit 924410f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

open_mode_bsd.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ package fsnotify
88

99
import "golang.org/x/sys/unix"
1010

11-
const openMode = unix.O_NONBLOCK | unix.O_RDONLY
11+
const openMode = unix.O_NONBLOCK | unix.O_RDONLY | unix.O_CLOEXEC

open_mode_darwin.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ package fsnotify
99
import "golang.org/x/sys/unix"
1010

1111
// note: this constant is not defined on BSD
12-
const openMode = unix.O_EVTONLY
12+
const openMode = unix.O_EVTONLY | unix.O_CLOEXEC

0 commit comments

Comments
 (0)