aboutsummaryrefslogtreecommitdiff
path: root/src/os/exec/exec_plan9.go
diff options
context:
space:
mode:
authorChressie Himpel <chressie@google.com>2022-04-27 20:09:28 +0200
committerChressie Himpel <chressie@google.com>2022-04-27 20:09:28 +0200
commitec7f5165ddc680efbac18dc15b4905844d9e8db9 (patch)
treeeacc43345e3d6f0adfda16bfcf66e7e5096a85b9 /src/os/exec/exec_plan9.go
parentca6fd39cf6498d4507fc7cdaced55620c283a503 (diff)
parentf0ee7fda636408b4f04ca3f3b11788f662c90610 (diff)
downloadgo-ec7f5165ddc680efbac18dc15b4905844d9e8db9.tar.gz
go-ec7f5165ddc680efbac18dc15b4905844d9e8db9.zip
[dev.boringcrypto] all: merge master into dev.boringcrypto
Change-Id: Ic5f71c04f08c03319c043f35be501875adb0a3b0
Diffstat (limited to 'src/os/exec/exec_plan9.go')
-rw-r--r--src/os/exec/exec_plan9.go20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/os/exec/exec_plan9.go b/src/os/exec/exec_plan9.go
index 21ac7b765f1..8920bec1f5e 100644
--- a/src/os/exec/exec_plan9.go
+++ b/src/os/exec/exec_plan9.go
@@ -6,14 +6,14 @@ package exec
import "io/fs"
-func init() {
- skipStdinCopyError = func(err error) bool {
- // Ignore hungup errors copying to stdin if the program
- // completed successfully otherwise.
- // See Issue 35753.
- pe, ok := err.(*fs.PathError)
- return ok &&
- pe.Op == "write" && pe.Path == "|1" &&
- pe.Err.Error() == "i/o on hungup channel"
- }
+// skipStdinCopyError optionally specifies a function which reports
+// whether the provided stdin copy error should be ignored.
+func skipStdinCopyError(err error) bool {
+ // Ignore hungup errors copying to stdin if the program
+ // completed successfully otherwise.
+ // See Issue 35753.
+ pe, ok := err.(*fs.PathError)
+ return ok &&
+ pe.Op == "write" && pe.Path == "|1" &&
+ pe.Err.Error() == "i/o on hungup channel"
}