Skip to content

Commit

Permalink
Change syscall.EPOLLET to unix.EPOLLET
Browse files Browse the repository at this point in the history
syscall.EPOLLET has been defined with different values on amd64 and
arm64(-0x80000000 on amd64, and 0x80000000 on arm64), while unix.EPOLLET
has been unified this value to 0x80000000(golang/go#5328). ref google#63

Signed-off-by: Haibo Xu <haibo.xu@arm.com>
Change-Id: Id97d075c4e79d86a2ea3227ffbef02d8b00ffbb8
  • Loading branch information
Haibo Xu committed Aug 5, 2019
1 parent 960a5e5 commit 83fdb77
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
5 changes: 4 additions & 1 deletion pkg/fdnotifier/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,8 @@ go_library(
],
importpath = "gvisor.dev/gvisor/pkg/fdnotifier",
visibility = ["//:sandbox"],
deps = ["//pkg/waiter"],
deps = [
"//pkg/waiter",
"@org_golang_x_sys//unix:go_default_library",
],
)
3 changes: 2 additions & 1 deletion pkg/fdnotifier/fdnotifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"sync"
"syscall"

"golang.org/x/sys/unix"
"gvisor.dev/gvisor/pkg/waiter"
)

Expand Down Expand Up @@ -72,7 +73,7 @@ func (n *notifier) waitFD(fd int32, fi *fdInfo, mask waiter.EventMask) error {
}

e := syscall.EpollEvent{
Events: mask.ToLinux() | -syscall.EPOLLET,
Events: mask.ToLinux() | unix.EPOLLET,
Fd: fd,
}

Expand Down
1 change: 1 addition & 0 deletions pkg/sentry/socket/rpcinet/notifier/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ go_library(
"//pkg/sentry/socket/rpcinet:syscall_rpc_go_proto",
"//pkg/sentry/socket/rpcinet/conn",
"//pkg/waiter",
"@org_golang_x_sys//unix:go_default_library",
],
)
3 changes: 2 additions & 1 deletion pkg/sentry/socket/rpcinet/notifier/notifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"sync"
"syscall"

"golang.org/x/sys/unix"
"gvisor.dev/gvisor/pkg/sentry/socket/rpcinet/conn"
pb "gvisor.dev/gvisor/pkg/sentry/socket/rpcinet/syscall_rpc_go_proto"
"gvisor.dev/gvisor/pkg/waiter"
Expand Down Expand Up @@ -76,7 +77,7 @@ func (n *Notifier) waitFD(fd uint32, fi *fdInfo, mask waiter.EventMask) error {
}

e := pb.EpollEvent{
Events: mask.ToLinux() | -syscall.EPOLLET,
Events: mask.ToLinux() | unix.EPOLLET,
Fd: fd,
}

Expand Down

0 comments on commit 83fdb77

Please sign in to comment.