summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/vfs/epoll.go
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-02-25 21:40:09 +0000
committergVisor bot <gvisor-bot@google.com>2020-02-25 21:40:09 +0000
commited9085d4e5d4944ab662a58ee3a33d3b5210bd3e (patch)
treeae6b893d1b673b9020cf1cf3d66c5071e492d7fb /pkg/sentry/vfs/epoll.go
parenta59ee560978159013ade1bfb878d39cf9c551476 (diff)
parent471b15b212831af31c2fe36cd42cea7ec7b7785b (diff)
Merge release-20200219.0-37-g471b15b (automated)
Diffstat (limited to 'pkg/sentry/vfs/epoll.go')
-rwxr-xr-xpkg/sentry/vfs/epoll.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/pkg/sentry/vfs/epoll.go b/pkg/sentry/vfs/epoll.go
index eed41139b..3da45d744 100755
--- a/pkg/sentry/vfs/epoll.go
+++ b/pkg/sentry/vfs/epoll.go
@@ -202,6 +202,9 @@ func (ep *EpollInstance) AddInterest(file *FileDescription, num int32, event lin
// Add epi to file.epolls so that it is removed when the last
// FileDescription reference is dropped.
file.epollMu.Lock()
+ if file.epolls == nil {
+ file.epolls = make(map[*epollInterest]struct{})
+ }
file.epolls[epi] = struct{}{}
file.epollMu.Unlock()