Skip to content

Commit

Permalink
Merge pull request #549 from crosbymichael/tty-close
Browse files Browse the repository at this point in the history
Close tty on error before handler
  • Loading branch information
LK4D4 committed Feb 10, 2016
2 parents 4678b01 + 4567558 commit 1a124e9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,13 +308,15 @@ func runProcess(container libcontainer.Container, config *specs.Process, listenF
}

if err := container.Start(process); err != nil {
tty.Close()
return -1, err
}

if pidFile != "" {
if err := createPidFile(pidFile, process); err != nil {
process.Signal(syscall.SIGKILL)
process.Wait()
tty.Close()
return -1, err
}
}
Expand Down

0 comments on commit 1a124e9

Please sign in to comment.