Skip to content

Commit 788a996

Browse files
committed
kqueue: set O_CLOEXEC on close pipe fds
These file descriptors are being leaked to child processes because O_CLOEXEC isn't set.
1 parent 5d58403 commit 788a996

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎backend_kqueue.go‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,8 @@ func newKqueue() (kq int, closepipe [2]int, err error) {
197197
unix.Close(kq)
198198
return kq, closepipe, err
199199
}
200+
unix.CloseOnExec(closepipe[0])
201+
unix.CloseOnExec(closepipe[1])
200202

201203
// Register changes to listen on the closepipe.
202204
changes := make([]unix.Kevent_t, 1)

0 commit comments

Comments
 (0)