vendor/github.com/fsnotify/fsnotify/inotify_poller.go
changeset 260 445e01aede7e
parent 256 6d9efbef00a9
equal deleted inserted replaced
259:db4911b0c721 260:445e01aede7e
     1 // Copyright 2015 The Go Authors. All rights reserved.
     1 // Copyright 2015 The Go Authors. All rights reserved.
     2 // Use of this source code is governed by a BSD-style
     2 // Use of this source code is governed by a BSD-style
     3 // license that can be found in the LICENSE file.
     3 // license that can be found in the LICENSE file.
     4 
     4 
       
     5 //go:build linux
     5 // +build linux
     6 // +build linux
     6 
     7 
     7 package fsnotify
     8 package fsnotify
     8 
     9 
     9 import (
    10 import (
    35 	defer func() {
    36 	defer func() {
    36 		if errno != nil {
    37 		if errno != nil {
    37 			poller.close()
    38 			poller.close()
    38 		}
    39 		}
    39 	}()
    40 	}()
    40 	poller.fd = fd
       
    41 
    41 
    42 	// Create epoll fd
    42 	// Create epoll fd
    43 	poller.epfd, errno = unix.EpollCreate1(unix.EPOLL_CLOEXEC)
    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