| 1 |
// Copyright 2019 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. |
| 4 |
|
| 5 |
package exec |
| 6 |
|
| 7 |
import "io/fs" |
| 8 |
|
| 9 |
func init() { |
| 10 |
skipStdinCopyError = func(err error) bool { |
| 11 |
// Ignore hungup errors copying to stdin if the program |
| 12 |
// completed successfully otherwise. |
| 13 |
// See Issue 35753. |
| 14 |
pe, ok := err.(*fs.PathError) |
| 15 |
return ok && |
| 16 |
pe.Op == "write" && pe.Path == "|1" && |
| 17 |
pe.Err.Error() == "i/o on hungup channel" |
| 18 |
} |
| 19 |
} |