Skip to content

Commit

Permalink
fix arm flag
Browse files Browse the repository at this point in the history
  • Loading branch information
xtaci committed Jun 11, 2021
1 parent cc20498 commit 2fcc590
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -587,8 +587,6 @@ func (w *watcher) handleEvents(pe pollerEvents) {
//log.Println(e)
for _, e := range pe {
if desc, ok := w.descs[e.ident]; ok {
var shouldRearmRead bool
var shouldRearmWrite bool
if e.ev&EV_READ != 0 {
desc.r_armed = false
var next *list.Element
Expand All @@ -604,7 +602,6 @@ func (w *watcher) handleEvents(pe pollerEvents) {
}

if desc.readers.Len() > 0 {
shouldRearmRead = true
desc.r_armed = true
}
}
Expand All @@ -624,13 +621,12 @@ func (w *watcher) handleEvents(pe pollerEvents) {
}

if desc.writers.Len() > 0 {
shouldRearmWrite = true
desc.w_armed = true
}
}

if shouldRearmRead || shouldRearmWrite {
w.pfd.Rearm(e.ident, shouldRearmRead, shouldRearmWrite)
if desc.r_armed || desc.w_armed {
w.pfd.Rearm(e.ident, desc.r_armed, desc.w_armed)
}
}
}
Expand Down

0 comments on commit 2fcc590

Please sign in to comment.