Skip to content

Commit

Permalink
more error info
Browse files Browse the repository at this point in the history
  • Loading branch information
cheng-zhongliang committed Aug 12, 2023
1 parent d18ba0f commit dbaf213
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions epoll.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,15 @@ func (ep *epoll) add(ev *Event) error {
es, ok := ep.fdEvs[ev.fd]
if ok {
op = syscall.EPOLL_CTL_MOD
if es.events&ev.events != 0 {
return ErrEventExists
}
} else {
es = &fdEvent{}
ep.fdEvs[ev.fd] = es
}

if es.events&ev.events != 0 {
return ErrEventExists
}

es.events |= ev.events

if ev.events&EvRead != 0 {
Expand Down

0 comments on commit dbaf213

Please sign in to comment.