diff options
| author | Tobias Klauser <tklauser@distanz.ch> | 2024-04-02 11:23:47 +0200 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2024-04-02 21:49:26 +0000 |
| commit | e074fcc945da2ed2384d562425a7e15b24d15b55 (patch) | |
| tree | 59c9d4038bb8ec8fdf6dd9a197588ac84005ea7b /src/os/readfrom_linux_test.go | |
| parent | b6efc3b755b74147a3700ad51773b01fa68f76e8 (diff) | |
| download | go-e074fcc945da2ed2384d562425a7e15b24d15b55.tar.xz | |
internal/poll, net, os: remove poll.Splice syscall name return value
The sc return value of internal/poll.Splice is always set to the same
value "splice" in the error case and then passed to wrapSyscallError.
Move that value to the wrapSyscallError calls to simplify the code a
bit.
Change-Id: I98104d755da68ff9f301fabc43c2618fda21a175
Reviewed-on: https://go-review.googlesource.com/c/go/+/575655
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com>
Diffstat (limited to 'src/os/readfrom_linux_test.go')
| -rw-r--r-- | src/os/readfrom_linux_test.go | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/os/readfrom_linux_test.go b/src/os/readfrom_linux_test.go index b292bffe2b..8dcb9cb217 100644 --- a/src/os/readfrom_linux_test.go +++ b/src/os/readfrom_linux_test.go @@ -693,21 +693,20 @@ type spliceFileHook struct { written int64 handled bool - sc string err error - original func(dst, src *poll.FD, remain int64) (int64, bool, string, error) + original func(dst, src *poll.FD, remain int64) (int64, bool, error) } func (h *spliceFileHook) install() { h.original = *PollSpliceFile - *PollSpliceFile = func(dst, src *poll.FD, remain int64) (int64, bool, string, error) { + *PollSpliceFile = func(dst, src *poll.FD, remain int64) (int64, bool, error) { h.called = true h.dstfd = dst.Sysfd h.srcfd = src.Sysfd h.remain = remain - h.written, h.handled, h.sc, h.err = h.original(dst, src, remain) - return h.written, h.handled, h.sc, h.err + h.written, h.handled, h.err = h.original(dst, src, remain) + return h.written, h.handled, h.err } } |
