packer: In the case of an error, close stdout/stderr writers

This commit is contained in:
Mitchell Hashimoto 2013-07-23 22:46:51 -05:00
parent b64a2532f4
commit 7472bbb17c
1 changed files with 2 additions and 0 deletions

View File

@ -65,6 +65,8 @@ type Communicator interface {
func (r *RemoteCmd) StartWithUi(c Communicator, ui Ui) error {
stdout_r, stdout_w := io.Pipe()
stderr_r, stderr_w := io.Pipe()
defer stdout_w.Close()
defer stderr_w.Close()
// Set the writers for the output so that we get it streamed to us
if r.Stdout == nil {