Skip to content
This repository was archived by the owner on Jun 8, 2022. It is now read-only.

Commit 7beb451

Browse files
committed
Linux - Remove Select() syscall for now
Needs more testing, getting reports from users of no new events on some Linux systems after adding Select() call.
1 parent 26afc98 commit 7beb451

File tree

1 file changed

+0
-16
lines changed

1 file changed

+0
-16
lines changed

fsnotify_linux.go

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -203,18 +203,7 @@ func (w *Watcher) readEvents() {
203203
errno error // Syscall errno
204204
)
205205

206-
rfds := &syscall.FdSet{}
207-
timeout := &syscall.Timeval{}
208-
209206
for {
210-
// Select to see if data available
211-
*timeout = syscall.NsecToTimeval(selectWaitTime)
212-
FD_ZERO(rfds)
213-
FD_SET(rfds, w.fd)
214-
if _, errno = syscall.Select(w.fd+1, rfds, nil, nil, timeout); errno != nil {
215-
w.Error <- os.NewSyscallError("select", errno)
216-
}
217-
218207
// See if there is a message on the "done" channel
219208
select {
220209
case <-w.done:
@@ -225,12 +214,7 @@ func (w *Watcher) readEvents() {
225214
default:
226215
}
227216

228-
// Check select result to see if Read will block, only read if no blocking.
229-
if FD_ISSET(rfds, w.fd) {
230217
n, errno = syscall.Read(w.fd, buf[0:])
231-
} else {
232-
continue
233-
}
234218

235219
// If EOF is received
236220
if n == 0 {

0 commit comments

Comments
 (0)