Selaa lähdekoodia

Skip Close()-ing stdin on Darwin. The Return.

This was accidentally removed in https://github.com/docker/docker/pull/16289
Now adding it back.

Signed-off-by: Tibor Vass <tibor@docker.com>
Tibor Vass 9 vuotta sitten
vanhempi
commit
6da35a288f
1 muutettua tiedostoa jossa 5 lisäystä ja 1 poistoa
  1. 5 1
      api/client/cli.go

+ 5 - 1
api/client/cli.go

@@ -96,7 +96,11 @@ func (cli *DockerCli) restoreTerminal(in io.Closer) error {
 	if cli.state != nil {
 	if cli.state != nil {
 		term.RestoreTerminal(cli.inFd, cli.state)
 		term.RestoreTerminal(cli.inFd, cli.state)
 	}
 	}
-	if in != nil {
+	// WARNING: DO NOT REMOVE THE OS CHECK !!!
+	// 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 in != nil && runtime.GOOS != "darwin" {
 		return in.Close()
 		return in.Close()
 	}
 	}
 	return nil
 	return nil