Skip to content

Commit

Permalink
retry ioctl on EINTR, likely required for Go 1.14
Browse files Browse the repository at this point in the history
  • Loading branch information
temoto committed Sep 29, 2020
1 parent e48daef commit fc5a1b8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 4 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ cache:
- $HOME/gopath/pkg/mod
language: go
go:
- 1.11
- 1.12
- 1.13
- 1.14
- 1.15
- 1.x
env: GO111MODULE=on
install: true
Expand All @@ -26,7 +27,7 @@ jobs:
language: go
go: 1.x
env: task=lint GO111MODULE=on
install: curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | bash -s -- -b $HOME/bin v1.19.1
install: curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | bash -s -- -b $HOME/bin v1.31.0
script:
- go mod tidy && git diff --exit-code
- $HOME/bin/golangci-lint run
Expand Down
4 changes: 4 additions & 0 deletions ffi.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,11 @@ func RawSetLineValues(fd int, arg *HandleData) error {
}

func ioctl(fd int, op, arg uintptr) error {
retry:
r, _, errno := syscall.Syscall(syscall.SYS_IOCTL, uintptr(fd), op, arg)
if errno == syscall.EINTR {
goto retry
}
if errno != 0 {
err := os.NewSyscallError("SYS_IOCTL", errno)
// log.Printf("ioctl fd=%d op=%x arg=%x err=%v", fd, op, arg, err)
Expand Down

0 comments on commit fc5a1b8

Please sign in to comment.