Skip to content

Commit

Permalink
Review comment: move pty's Close
Browse files Browse the repository at this point in the history
  • Loading branch information
Alfonso Acosta committed Apr 1, 2016
1 parent 4a49607 commit 2c4de62
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions probe/host/controls.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,17 @@ func (r *Reporter) execHost(req xfer.Request) xfer.Response {
}
pipe.OnClose(func() {
if err := cmd.Process.Kill(); err != nil {
log.Errorf("Error closing host shell: %v", err)
return
log.Errorf("Error stopping host shell: %v", err)
}
if err := ptyPipe.Close(); err != nil {
log.Errorf("Error closing host shell's pty: %v", err)
}
log.Info("Host shell closed.")
})
go func() {
if err := cmd.Wait(); err != nil {
log.Errorf("Error waiting on host shell: %v", err)
}
ptyPipe.Close()
pipe.Close()
}()

Expand Down

0 comments on commit 2c4de62

Please sign in to comment.