]> go.fuhry.dev Git - fsnotify.git/commitdiff
Don't set poller.fd twice in newFdPoller (#406)
authorTobias Klauser <tklauser@distanz.ch>
Wed, 19 Jan 2022 14:22:52 +0000 (15:22 +0100)
committerGitHub <noreply@github.com>
Wed, 19 Jan 2022 14:22:52 +0000 (09:22 -0500)
In newEmptyPoller when creating the poller using newEmptyPoller(fd), the
fd field of the poller instance is already set. There is no need to set
it again.

inotify_poller.go

index e9ff9439f7f096cab94b43a40868b0e0fa454e64..b572a37c3f1ad98e1ec104283584146f23c9d0fc 100644 (file)
@@ -38,7 +38,6 @@ func newFdPoller(fd int) (*fdPoller, error) {
                        poller.close()
                }
        }()
-       poller.fd = fd
 
        // Create epoll fd
        poller.epfd, errno = unix.EpollCreate1(unix.EPOLL_CLOEXEC)