]> Cypherpunks repositories - gostls13.git/commit
syscall: on freebsd-386 only update written for certain errors
authorIan Lance Taylor <iant@golang.org>
Thu, 12 Dec 2024 22:07:13 +0000 (14:07 -0800)
committerGopher Robot <gobot@golang.org>
Thu, 12 Dec 2024 22:43:37 +0000 (14:43 -0800)
commit38e9a671d7648227f4f5b133e2e6452491cccebf
treebe21e9758d502691594626554d130c28c2828cfa
parent6f7a4540b13d6d3be997276178aed96fb0e8a9c2
syscall: on freebsd-386 only update written for certain errors

Testing on the freebsd-386 gomote seems to show that sendfile returns
a non-zero number of bytes written even when it returns EINVAL.
This confuses the caller. Change the Go code to only return non-zero
on success or EINTR or EAGAIN, which are the only cases where the
man page says that sendfile updates the number of bytes.

For #70763

Change-Id: Icc04e6286b5b29a2029237711d50fe4973234f0a
Reviewed-on: https://go-review.googlesource.com/c/go/+/635815
Reviewed-by: Ian Lance Taylor <iant@google.com>
Commit-Queue: Ian Lance Taylor <iant@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
src/syscall/syscall_freebsd_386.go