Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
pilot committed Oct 11, 2023
1 parent a5dc367 commit f509922
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions epoll.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ func (ep *poller) add(ev *Event) error {
es.evs |= syscall.EPOLLET & maxUint32
}

epEv := &syscall.EpollEvent{Events: es.evs}
epEv := syscall.EpollEvent{Events: es.evs}

*(**fdEvent)(unsafe.Pointer(&epEv.Fd)) = es

return syscall.EpollCtl(ep.fd, op, ev.fd, epEv)
return syscall.EpollCtl(ep.fd, op, ev.fd, &epEv)
}

func (ep *poller) del(ev *Event) error {
Expand Down Expand Up @@ -107,11 +107,11 @@ func (ep *poller) del(ev *Event) error {
op = syscall.EPOLL_CTL_MOD
}

epEv := &syscall.EpollEvent{Events: es.evs}
epEv := syscall.EpollEvent{Events: es.evs}

*(**fdEvent)(unsafe.Pointer(&epEv.Fd)) = es

return syscall.EpollCtl(ep.fd, op, ev.fd, epEv)
return syscall.EpollCtl(ep.fd, op, ev.fd, &epEv)
}

func (ep *poller) polling(cb func(ev *Event, res uint32), timeout time.Duration) error {
Expand Down

0 comments on commit f509922

Please sign in to comment.