diff options
author | gVisor bot <gvisor-bot@google.com> | 2019-12-16 22:43:48 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2019-12-16 22:43:48 +0000 |
commit | d646a6798aefea611b06543644112df903ed2428 (patch) | |
tree | 2fbdede54ce65bf4f1437ec4a4aa7566e17b60d0 /pkg | |
parent | c46ddf9c69d71989996115194fbb7b70155396c9 (diff) | |
parent | 3193b2fff8149fe43a3a59c266359e7f443a1563 (diff) |
Merge release-20191210.0-32-g3193b2f (automated)
Diffstat (limited to 'pkg')
-rwxr-xr-x | pkg/sentry/strace/select.go | 4 | ||||
-rw-r--r-- | pkg/sentry/syscalls/linux/sys_poll.go | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/pkg/sentry/strace/select.go b/pkg/sentry/strace/select.go index 92c18083d..dea309fda 100755 --- a/pkg/sentry/strace/select.go +++ b/pkg/sentry/strace/select.go @@ -27,7 +27,7 @@ func fdsFromSet(t *kernel.Task, set []byte) []int { // Append n if the n-th bit is 1. for i, v := range set { for j := 0; j < 8; j++ { - if (v>>uint(j))&1 == 1 { + if (v>>j)&1 == 1 { fds = append(fds, i*8+j) } } @@ -42,7 +42,7 @@ func fdSet(t *kernel.Task, nfds int, addr usermem.Addr) string { // Calculate the size of the fd set (one bit per fd). nBytes := (nfds + 7) / 8 - nBitsInLastPartialByte := uint(nfds % 8) + nBitsInLastPartialByte := nfds % 8 set, err := linux.CopyInFDSet(t, addr, nBytes, nBitsInLastPartialByte) if err != nil { diff --git a/pkg/sentry/syscalls/linux/sys_poll.go b/pkg/sentry/syscalls/linux/sys_poll.go index 631dffec6..2b2df989a 100644 --- a/pkg/sentry/syscalls/linux/sys_poll.go +++ b/pkg/sentry/syscalls/linux/sys_poll.go @@ -198,7 +198,7 @@ func doPoll(t *kernel.Task, addr usermem.Addr, nfds uint, timeout time.Duration) } // CopyInFDSet copies an fd set from select(2)/pselect(2). -func CopyInFDSet(t *kernel.Task, addr usermem.Addr, nBytes int, nBitsInLastPartialByte uint) ([]byte, error) { +func CopyInFDSet(t *kernel.Task, addr usermem.Addr, nBytes, nBitsInLastPartialByte int) ([]byte, error) { set := make([]byte, nBytes) if addr != 0 { @@ -222,7 +222,7 @@ func doSelect(t *kernel.Task, nfds int, readFDs, writeFDs, exceptFDs usermem.Add // Calculate the size of the fd sets (one bit per fd). nBytes := (nfds + 7) / 8 - nBitsInLastPartialByte := uint(nfds % 8) + nBitsInLastPartialByte := nfds % 8 // Capture all the provided input vectors. r, err := CopyInFDSet(t, readFDs, nBytes, nBitsInLastPartialByte) |