vendor/github.com/fsnotify/fsnotify/inotify_poller.go
changeset 256 6d9efbef00a9
parent 242 2a9ec03fe5a1
child 260 445e01aede7e
equal deleted inserted replaced
255:4f153a23adab 256:6d9efbef00a9
    38 		}
    38 		}
    39 	}()
    39 	}()
    40 	poller.fd = fd
    40 	poller.fd = fd
    41 
    41 
    42 	// Create epoll fd
    42 	// Create epoll fd
    43 	poller.epfd, errno = unix.EpollCreate1(0)
    43 	poller.epfd, errno = unix.EpollCreate1(unix.EPOLL_CLOEXEC)
    44 	if poller.epfd == -1 {
    44 	if poller.epfd == -1 {
    45 		return nil, errno
    45 		return nil, errno
    46 	}
    46 	}
    47 	// Create pipe; pipe[0] is the read end, pipe[1] the write end.
    47 	// Create pipe; pipe[0] is the read end, pipe[1] the write end.
    48 	errno = unix.Pipe2(poller.pipe[:], unix.O_NONBLOCK)
    48 	errno = unix.Pipe2(poller.pipe[:], unix.O_NONBLOCK|unix.O_CLOEXEC)
    49 	if errno != nil {
    49 	if errno != nil {
    50 		return nil, errno
    50 		return nil, errno
    51 	}
    51 	}
    52 
    52 
    53 	// Register inotify fd with epoll
    53 	// Register inotify fd with epoll