1
0
mirror of https://github.com/golang/go synced 2024-10-01 22:08:32 -06:00

exec: closeAfterWait append bug

Wasn't actually eager closing the fds as a result of the
copy/paste bug. (GC was doing it instead)

R=rsc
CC=golang-dev
https://golang.org/cl/4671057
This commit is contained in:
Brad Fitzpatrick 2011-07-11 14:46:46 -07:00
parent 2f69a73591
commit d1f4e0d14e

View File

@ -332,7 +332,7 @@ func (c *Cmd) StdinPipe() (io.WriteCloser, os.Error) {
}
c.Stdin = pr
c.closeAfterStart = append(c.closeAfterStart, pr)
c.closeAfterWait = append(c.closeAfterStart, pw)
c.closeAfterWait = append(c.closeAfterWait, pw)
return pw, nil
}
@ -351,7 +351,7 @@ func (c *Cmd) StdoutPipe() (io.Reader, os.Error) {
}
c.Stdout = pw
c.closeAfterStart = append(c.closeAfterStart, pw)
c.closeAfterWait = append(c.closeAfterStart, pr)
c.closeAfterWait = append(c.closeAfterWait, pr)
return pr, nil
}
@ -370,6 +370,6 @@ func (c *Cmd) StderrPipe() (io.Reader, os.Error) {
}
c.Stderr = pw
c.closeAfterStart = append(c.closeAfterStart, pw)
c.closeAfterWait = append(c.closeAfterStart, pr)
c.closeAfterWait = append(c.closeAfterWait, pr)
return pr, nil
}