From 5656d2322117a47ef40f5bf938b2e46228f36fdb Mon Sep 17 00:00:00 2001 From: "Guillaume J. Charmes" Date: Tue, 11 Mar 2014 17:10:05 -0700 Subject: [PATCH] Fix attach exit on darwin Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes (github: creack) Upstream-commit: 95e5910ab23e3ef7b0154f64e1c6ae01bc647ab3 Component: engine --- components/engine/api/client.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/components/engine/api/client.go b/components/engine/api/client.go index 599d82b39a..3dc64e6d55 100644 --- a/components/engine/api/client.go +++ b/components/engine/api/client.go @@ -28,7 +28,7 @@ import ( "path" "reflect" "regexp" - "runtime" + goruntime "runtime" "strconv" "strings" "syscall" @@ -367,7 +367,7 @@ func (cli *DockerCli) CmdVersion(args ...string) error { if dockerversion.VERSION != "" { fmt.Fprintf(cli.out, "Client version: %s\n", dockerversion.VERSION) } - fmt.Fprintf(cli.out, "Go version (client): %s\n", runtime.Version()) + fmt.Fprintf(cli.out, "Go version (client): %s\n", goruntime.Version()) if dockerversion.GITCOMMIT != "" { fmt.Fprintf(cli.out, "Git commit (client): %s\n", dockerversion.GITCOMMIT) } @@ -2249,7 +2249,12 @@ func (cli *DockerCli) hijack(method, path string, setRawTerminal bool, in io.Rea if setRawTerminal && cli.isTerminal { term.RestoreTerminal(cli.terminalFd, oldState) } - in.Close() + // For some reason this Close call blocks on darwin.. + // As the client exists right after, simply discard the close + // until we find a better solution. + if goruntime.GOOS != "darwin" { + in.Close() + } } }()