From 1eaaa6b744b8017e7d31bdf9dc7095663b4c930c Mon Sep 17 00:00:00 2001 From: "Guillaume J. Charmes" Date: Tue, 9 Apr 2013 10:02:57 -0700 Subject: [PATCH] Flush stdout on import to avoid deadklock when waiting for stdin (import -). Fixed #365 --- commands.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/commands.go b/commands.go index 9a520da8a0..2c098d5196 100644 --- a/commands.go +++ b/commands.go @@ -419,7 +419,8 @@ func (srv *Server) CmdKill(stdin io.ReadCloser, stdout io.Writer, args ...string return nil } -func (srv *Server) CmdImport(stdin io.ReadCloser, stdout io.Writer, args ...string) error { +func (srv *Server) CmdImport(stdin io.ReadCloser, stdout rcli.DockerConn, args ...string) error { + stdout.Flush() cmd := rcli.Subcmd(stdout, "import", "[OPTIONS] URL|- [REPOSITORY [TAG]]", "Create a new filesystem image from the contents of a tarball") var archive io.Reader var resp *http.Response