mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
Merge pull request #558 from rajasec/tty-panic
panic during start of failed detached container
This commit is contained in:
+6
-2
@@ -137,14 +137,18 @@ func restoreContainer(context *cli.Context, spec *specs.LinuxSpec, config *confi
|
|||||||
handler := newSignalHandler(tty)
|
handler := newSignalHandler(tty)
|
||||||
defer handler.Close()
|
defer handler.Close()
|
||||||
if err := container.Restore(process, options); err != nil {
|
if err := container.Restore(process, options); err != nil {
|
||||||
tty.Close()
|
if tty != nil {
|
||||||
|
tty.Close()
|
||||||
|
}
|
||||||
return -1, err
|
return -1, err
|
||||||
}
|
}
|
||||||
if pidFile := context.String("pid-file"); pidFile != "" {
|
if pidFile := context.String("pid-file"); pidFile != "" {
|
||||||
if err := createPidFile(pidFile, process); err != nil {
|
if err := createPidFile(pidFile, process); err != nil {
|
||||||
process.Signal(syscall.SIGKILL)
|
process.Signal(syscall.SIGKILL)
|
||||||
process.Wait()
|
process.Wait()
|
||||||
tty.Close()
|
if tty != nil {
|
||||||
|
tty.Close()
|
||||||
|
}
|
||||||
return -1, err
|
return -1, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user