From: Chris Howey Date: Wed, 3 Jul 2013 12:47:43 +0000 (-0500) Subject: Linux - Remove Select() syscall for now X-Git-Tag: v1.7.2~345 X-Git-Url: https://go.fuhry.dev/?a=commitdiff_plain;h=7beb45183d2ab48bfc9616d9a019513a123a4983;p=fsnotify.git 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. --- diff --git a/fsnotify_linux.go b/fsnotify_linux.go index 2ee1d4d..ff2f235 100644 --- a/fsnotify_linux.go +++ b/fsnotify_linux.go @@ -203,18 +203,7 @@ func (w *Watcher) readEvents() { errno error // Syscall errno ) - rfds := &syscall.FdSet{} - timeout := &syscall.Timeval{} - for { - // Select to see if data available - *timeout = syscall.NsecToTimeval(selectWaitTime) - FD_ZERO(rfds) - FD_SET(rfds, w.fd) - if _, errno = syscall.Select(w.fd+1, rfds, nil, nil, timeout); errno != nil { - w.Error <- os.NewSyscallError("select", errno) - } - // See if there is a message on the "done" channel select { case <-w.done: @@ -225,12 +214,7 @@ func (w *Watcher) readEvents() { default: } - // Check select result to see if Read will block, only read if no blocking. - if FD_ISSET(rfds, w.fd) { n, errno = syscall.Read(w.fd, buf[0:]) - } else { - continue - } // If EOF is received if n == 0 {