Merge pull request #1300 from hqhq/defer_tty_close_earlier

Call defer tty.Close() earlier
This commit is contained in:
Daniel, Dao Quang Minh 2017-01-27 16:20:20 +00:00 committed by GitHub
commit 82f9fdd690
1 changed files with 1 additions and 1 deletions

View File

@ -239,6 +239,7 @@ func (r *runner) run(config *specs.Process) (int, error) {
r.destroy()
return -1, err
}
defer tty.Close()
if err = startFn(process); err != nil {
r.destroy()
return -1, err
@ -250,7 +251,6 @@ func (r *runner) run(config *specs.Process) (int, error) {
return -1, err
}
}
defer tty.Close()
if config.Terminal && detach {
conn, err := net.Dial("unix", r.consoleSocket)