]> go.fuhry.dev Git - fsnotify.git/commitdiff
BSD - fix for rob (EINTR)
authorChris Howey <chris@howey.me>
Wed, 4 Apr 2012 22:44:59 +0000 (17:44 -0500)
committerChris Howey <chris@howey.me>
Wed, 4 Apr 2012 22:44:59 +0000 (17:44 -0500)
fsnotify_bsd.go

index 872778b5e48d5b4dba83316286f23ca859ccac8d..c2537e2b472fa6bf7083a26034196a3ba789cb96 100644 (file)
@@ -212,14 +212,12 @@ func (w *Watcher) readEvents() {
                        if errno != nil && errno != syscall.EINTR {
                                w.Error <- os.NewSyscallError("kevent", errno)
                                continue
-                       } else {
-                               events = eventbuf[0:n]
                        }
-               }
 
-               // Timeout, no big deal
-               if n == 0 {
-                       continue
+                       // Received some events
+                       if n > 0 {
+                               events = eventbuf[0:n]
+                       }
                }
 
                // Flush the events we recieved to the events channel