From bf84c5bb7b8c3170bf220d0c48518525fc84fb32 Mon Sep 17 00:00:00 2001 From: Chris Howey Date: Wed, 4 Apr 2012 17:44:59 -0500 Subject: [PATCH] BSD - fix for rob (EINTR) --- fsnotify_bsd.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) 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 -- 2.50.1