Close tty on error before handler

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby 2016-02-10 13:41:35 -08:00
parent 4678b01e64
commit 45675581c1
1 changed files with 2 additions and 0 deletions

View File

@ -308,6 +308,7 @@ func runProcess(container libcontainer.Container, config *specs.Process, listenF
}
if err := container.Start(process); err != nil {
tty.Close()
return -1, err
}
@ -315,6 +316,7 @@ func runProcess(container libcontainer.Container, config *specs.Process, listenF
if err := createPidFile(pidFile, process); err != nil {
process.Signal(syscall.SIGKILL)
process.Wait()
tty.Close()
return -1, err
}
}