aboutsummaryrefslogtreecommitdiff
path: root/src/os/exec/exec_windows.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/os/exec/exec_windows.go')
-rw-r--r--src/os/exec/exec_windows.go22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/os/exec/exec_windows.go b/src/os/exec/exec_windows.go
index bb937f8aed..e7a2ee6c9d 100644
--- a/src/os/exec/exec_windows.go
+++ b/src/os/exec/exec_windows.go
@@ -9,15 +9,15 @@ import (
"syscall"
)
-func init() {
- skipStdinCopyError = func(err error) bool {
- // Ignore ERROR_BROKEN_PIPE and ERROR_NO_DATA errors copying
- // to stdin if the program completed successfully otherwise.
- // See Issue 20445.
- const _ERROR_NO_DATA = syscall.Errno(0xe8)
- pe, ok := err.(*fs.PathError)
- return ok &&
- pe.Op == "write" && pe.Path == "|1" &&
- (pe.Err == syscall.ERROR_BROKEN_PIPE || pe.Err == _ERROR_NO_DATA)
- }
+// skipStdinCopyError optionally specifies a function which reports
+// whether the provided stdin copy error should be ignored.
+func skipStdinCopyError(err error) bool {
+ // Ignore ERROR_BROKEN_PIPE and ERROR_NO_DATA errors copying
+ // to stdin if the program completed successfully otherwise.
+ // See Issue 20445.
+ const _ERROR_NO_DATA = syscall.Errno(0xe8)
+ pe, ok := err.(*fs.PathError)
+ return ok &&
+ pe.Op == "write" && pe.Path == "|1" &&
+ (pe.Err == syscall.ERROR_BROKEN_PIPE || pe.Err == _ERROR_NO_DATA)
}