2018-05-07 Edward Smith-Rowland <3dw4rd@verizon.net>
[official-gcc.git] / libgo / go / os / exec / exec_windows.go
blobaf8cd97218e4e3e166ff01aae56accd9ecfba196
1 // Copyright 2017 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
5 package exec
7 import (
8 "os"
9 "syscall"
12 func init() {
13 skipStdinCopyError = func(err error) bool {
14 // Ignore ERROR_BROKEN_PIPE and ERROR_NO_DATA errors copying
15 // to stdin if the program completed successfully otherwise.
16 // See Issue 20445.
17 const _ERROR_NO_DATA = syscall.Errno(0xe8)
18 pe, ok := err.(*os.PathError)
19 return ok &&
20 pe.Op == "write" && pe.Path == "|1" &&
21 (pe.Err == syscall.ERROR_BROKEN_PIPE || pe.Err == _ERROR_NO_DATA)