Skip to content

Commit

Permalink
Merge pull request #103 from asomers/issue_90
Browse files Browse the repository at this point in the history
fix crashes on kqueue-platforms when built with go-1.14
  • Loading branch information
fstab authored Jul 5, 2020
2 parents fdcf37e + 6a3c1c0 commit 46bd33d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tailer/fswatcher/fseventProducerLoop_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,11 @@ func runKeventLoop(kq int) *keventloop {
for {
eventBuf = make([]syscall.Kevent_t, 10)
n, err = syscall.Kevent(l.kq, nil, eventBuf, nil)
if err == syscall.EINTR || err == syscall.EBADF {
if err == syscall.EBADF {
// kq was closed, i.e. Close() was called.
return
} else if err == syscall.EINTR {
continue
} else if err != nil {
select {
case <-l.done:
Expand Down

0 comments on commit 46bd33d

Please sign in to comment.