diff options
Diffstat (limited to 'src/os/exec/exec_plan9.go')
-rw-r--r-- | src/os/exec/exec_plan9.go | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/os/exec/exec_plan9.go b/src/os/exec/exec_plan9.go index 21ac7b765f..8920bec1f5 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" } |