diff options
| author | Tobias Klauser <tklauser@distanz.ch> | 2025-01-14 11:26:06 +0100 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2025-02-03 08:34:15 -0800 |
| commit | 9896da303a74c7af02f711fbb49ac08e4ef3590b (patch) | |
| tree | 034e9f33a3e5cfa65e2debe7a2e2de5e8076e044 /src | |
| parent | cc874072f3778a2b2cbe972b703dd6552ae63831 (diff) | |
| download | go-9896da303a74c7af02f711fbb49ac08e4ef3590b.tar.xz | |
internal/poll: use ignoringEINTR2 in (*FD).Pread
Change-Id: I2af5f3f039b6c0e8e77484bd6b2cdb88e919a85d
Reviewed-on: https://go-review.googlesource.com/c/go/+/641759
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Diffstat (limited to 'src')
| -rw-r--r-- | src/internal/poll/fd_unix.go | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/internal/poll/fd_unix.go b/src/internal/poll/fd_unix.go index 2535a3ae4d..31e6e21120 100644 --- a/src/internal/poll/fd_unix.go +++ b/src/internal/poll/fd_unix.go @@ -183,16 +183,9 @@ func (fd *FD) Pread(p []byte, off int64) (int, error) { if fd.IsStream && len(p) > maxRW { p = p[:maxRW] } - var ( - n int - err error - ) - for { - n, err = syscall.Pread(fd.Sysfd, p, off) - if err != syscall.EINTR { - break - } - } + n, err := ignoringEINTR2(func() (int, error) { + return syscall.Pread(fd.Sysfd, p, off) + }) if err != nil { n = 0 } |
