diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-12-03 14:26:57 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-12-03 14:26:57 +0000 |
commit | b90360c0c293247f6e755e937ef518c1a9e0d2df (patch) | |
tree | 270a799d3b616e8648be3c22db446eb7ab9ee51c /pkg/sentry/kernel/epoll | |
parent | 194d07eeb5e3f0708fbfe4afd0d4d7dadd364863 (diff) | |
parent | 6f60a2b0a27a742690aa6acd5df1912ccb5fc8d3 (diff) |
Merge release-20201130.0-30-g6f60a2b0a (automated)
Diffstat (limited to 'pkg/sentry/kernel/epoll')
-rw-r--r-- | pkg/sentry/kernel/epoll/epoll.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/pkg/sentry/kernel/epoll/epoll.go b/pkg/sentry/kernel/epoll/epoll.go index 15519f0df..61aeca044 100644 --- a/pkg/sentry/kernel/epoll/epoll.go +++ b/pkg/sentry/kernel/epoll/epoll.go @@ -273,7 +273,7 @@ func (e *EventPoll) ReadEvents(max int) []linux.EpollEvent { // // Callback is called when one of the files we're polling becomes ready. It // moves said file to the readyList if it's currently in the waiting list. -func (p *pollEntry) Callback(*waiter.Entry) { +func (p *pollEntry) Callback(*waiter.Entry, waiter.EventMask) { e := p.epoll e.listsMu.Lock() @@ -306,9 +306,8 @@ func (e *EventPoll) initEntryReadiness(entry *pollEntry) { f.EventRegister(&entry.waiter, entry.mask) // Check if the file happens to already be in a ready state. - ready := f.Readiness(entry.mask) & entry.mask - if ready != 0 { - entry.Callback(&entry.waiter) + if ready := f.Readiness(entry.mask) & entry.mask; ready != 0 { + entry.Callback(&entry.waiter, ready) } } |