From 18d68cf1a94c4876c4c80f201010c0b49f37d085 Mon Sep 17 00:00:00 2001 From: Erik Hollensbe Date: Tue, 27 May 2014 12:25:27 -0700 Subject: [PATCH] libcontainer/nsinit: remove Wait call from Exec and Kill from Attach in tty_term.go Docker-DCO-1.1-Signed-off-by: Erik Hollensbe (github: erikh) --- libcontainer/nsinit/exec.go | 1 - libcontainer/nsinit/tty_term.go | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libcontainer/nsinit/exec.go b/libcontainer/nsinit/exec.go index 3545278..0813470 100644 --- a/libcontainer/nsinit/exec.go +++ b/libcontainer/nsinit/exec.go @@ -42,7 +42,6 @@ func Exec(container *libcontainer.Container, term Terminal, rootfs, dataPath str command := createCommand(container, console, rootfs, dataPath, os.Args[0], syncPipe.child, args) if err := term.Attach(command); err != nil { - command.Wait() return -1, err } defer term.Close() diff --git a/libcontainer/nsinit/tty_term.go b/libcontainer/nsinit/tty_term.go index fcbd085..fc6e1ab 100644 --- a/libcontainer/nsinit/tty_term.go +++ b/libcontainer/nsinit/tty_term.go @@ -28,10 +28,11 @@ func (t *TtyTerminal) Attach(command *exec.Cmd) error { go io.Copy(t.master, t.stdin) state, err := t.setupWindow(t.master, os.Stdin) + if err != nil { - command.Process.Kill() return err } + t.state = state return err }