aboutsummaryrefslogtreecommitdiff
path: root/src/os/exec/exec_unix.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/os/exec/exec_unix.go')
-rw-r--r--src/os/exec/exec_unix.go20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/os/exec/exec_unix.go b/src/os/exec/exec_unix.go
index c20f35276c..3ed672a744 100644
--- a/src/os/exec/exec_unix.go
+++ b/src/os/exec/exec_unix.go
@@ -11,14 +11,14 @@ import (
"syscall"
)
-func init() {
- skipStdinCopyError = func(err error) bool {
- // Ignore EPIPE errors copying to stdin if the program
- // completed successfully otherwise.
- // See Issue 9173.
- pe, ok := err.(*fs.PathError)
- return ok &&
- pe.Op == "write" && pe.Path == "|1" &&
- pe.Err == syscall.EPIPE
- }
+// skipStdinCopyError optionally specifies a function which reports
+// whether the provided stdin copy error should be ignored.
+func skipStdinCopyError(err error) bool {
+ // Ignore EPIPE errors copying to stdin if the program
+ // completed successfully otherwise.
+ // See Issue 9173.
+ pe, ok := err.(*fs.PathError)
+ return ok &&
+ pe.Op == "write" && pe.Path == "|1" &&
+ pe.Err == syscall.EPIPE
}