Minor cleanup

Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)
This commit is contained in:
Guillaume J. Charmes 2014-02-20 17:59:08 -08:00 committed by Michael Crosby
parent b2e01cbe8c
commit 41696722fa

View file

@ -56,11 +56,12 @@ func execCommand(container *libcontainer.Container, args []string) (int, error)
if err != nil { if err != nil {
return -1, err return -1, err
} }
sendVethName(vethPair, w) sendVethName(w, vethPair)
} }
// Sync with child // Sync with child
w.Close() w.Close()
r.Close()
go io.Copy(os.Stdout, master) go io.Copy(os.Stdout, master)
go io.Copy(master, os.Stdin) go io.Copy(master, os.Stdin)
@ -82,7 +83,7 @@ func execCommand(container *libcontainer.Container, args []string) (int, error)
// sendVethName writes the veth pair name to the child's stdin then closes the // sendVethName writes the veth pair name to the child's stdin then closes the
// pipe so that the child stops waiting for more data // pipe so that the child stops waiting for more data
func sendVethName(name string, pipe io.WriteCloser) { func sendVethName(pipe io.Writer, name string) {
fmt.Fprint(pipe, name) fmt.Fprint(pipe, name)
} }