aboutsummaryrefslogtreecommitdiff
path: root/src/os
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2024-04-02 11:23:47 +0200
committerGopher Robot <gobot@golang.org>2024-04-02 21:49:26 +0000
commite074fcc945da2ed2384d562425a7e15b24d15b55 (patch)
tree59c9d4038bb8ec8fdf6dd9a197588ac84005ea7b /src/os
parentb6efc3b755b74147a3700ad51773b01fa68f76e8 (diff)
downloadgo-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')
-rw-r--r--src/os/readfrom_linux_test.go9
-rw-r--r--src/os/zero_copy_linux.go5
2 files changed, 6 insertions, 8 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
}
}
diff --git a/src/os/zero_copy_linux.go b/src/os/zero_copy_linux.go
index d9cf18c22f..70a05ffa1e 100644
--- a/src/os/zero_copy_linux.go
+++ b/src/os/zero_copy_linux.go
@@ -87,14 +87,13 @@ func (f *File) spliceToFile(r io.Reader) (written int64, handled bool, err error
return
}
- var syscallName string
- written, handled, syscallName, err = pollSplice(&f.pfd, pfd, remain)
+ written, handled, err = pollSplice(&f.pfd, pfd, remain)
if lr != nil {
lr.N = remain - written
}
- return written, handled, wrapSyscallError(syscallName, err)
+ return written, handled, wrapSyscallError("splice", err)
}
func (f *File) copyFileRange(r io.Reader) (written int64, handled bool, err error) {