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

Commit

Permalink
Linux - Remove Select() syscall for now
Browse files Browse the repository at this point in the history
Needs more testing, getting reports from users of no new events
on some Linux systems after adding Select() call.
  • Loading branch information
howeyc committed Jul 3, 2013
1 parent 26afc98 commit 7beb451
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions fsnotify_linux.go
Expand Up @@ -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:
Expand All @@ -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 {
Expand Down

2 comments on commit 7beb451

@nathany
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Select was added in this commit: 3bfa915

@howeyc
Copy link
Owner Author

@howeyc howeyc commented on 7beb451 Jan 31, 2014 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.