aboutsummaryrefslogtreecommitdiff
path: root/src/os/exec/exec.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/os/exec/exec.go')
-rw-r--r--src/os/exec/exec.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/os/exec/exec.go b/src/os/exec/exec.go
index fcc37870ed..8a84e263dc 100644
--- a/src/os/exec/exec.go
+++ b/src/os/exec/exec.go
@@ -230,6 +230,7 @@ func (c *Cmd) writerDescriptor(w io.Writer) (f *os.File, err error) {
c.closeAfterWait = append(c.closeAfterWait, pr)
c.goroutine = append(c.goroutine, func() error {
_, err := io.Copy(w, pr)
+ pr.Close() // in case io.Copy stopped due to write error
return err
})
return pw, nil