From: Chris Howey Date: Wed, 4 Apr 2012 22:44:59 +0000 (-0500) Subject: BSD - fix for rob (EINTR) X-Git-Tag: v1.7.2~436 X-Git-Url: https://go.fuhry.dev/?a=commitdiff_plain;h=bf84c5bb7b8c3170bf220d0c48518525fc84fb32;p=fsnotify.git BSD - fix for rob (EINTR) --- diff --git a/fsnotify_bsd.go b/fsnotify_bsd.go index 872778b..c2537e2 100644 --- a/fsnotify_bsd.go +++ b/fsnotify_bsd.go @@ -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