Skip to content

Commit

Permalink
kqueue
Browse files Browse the repository at this point in the history
  • Loading branch information
cheng-zhongliang committed Oct 2, 2023
1 parent 4ffc7b4 commit 328ab84
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions kqueue.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,13 @@ func (kq *poller) polling(cb func(ev *Event, res uint32), timeout time.Duration)
kq.changes = kq.changes[:0]

for i := 0; i < n; i++ {
if flags := kq.events[i].Flags; flags&syscall.EV_ERROR != 0 {
if flags&uint16(syscall.EBADF|syscall.ENOENT|syscall.EINVAL) != 0 {
flags := kq.events[i].Flags
data := syscall.Errno(kq.events[i].Data)
if flags&syscall.EV_ERROR != 0 {
if data&(syscall.EBADF|syscall.ENOENT|syscall.EINVAL) != 0 {
continue
}
return syscall.Errno(kq.events[i].Data)
return data
}

which := uint32(0)
Expand Down

0 comments on commit 328ab84

Please sign in to comment.