From 8bf5613c1aca634e517e895e90e74f4263cf030f Mon Sep 17 00:00:00 2001 From: fy2462 Date: Thu, 28 Apr 2016 15:45:24 +0800 Subject: [PATCH] Fix bug: exec non-exist command miss a "\n" When exec a non-exist command, it should print a newline at last. Currently: ``` $ docker exec -ti f5f703ea2c0a144 bash rpc error: code = 2 desc = "oci runtime error: exec failed: exec: \"bash\": executable file not found in $PATH"$ ``` Signed-off-by: Feng Yan --- api/server/router/container/exec.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/server/router/container/exec.go b/api/server/router/container/exec.go index c5702a9dc1..fb88ac824a 100644 --- a/api/server/router/container/exec.go +++ b/api/server/router/container/exec.go @@ -110,8 +110,8 @@ func (s *containerRouter) postContainerExecStart(ctx context.Context, w http.Res if execStartCheck.Detach { return err } - stdout.Write([]byte(err.Error())) - logrus.Errorf("Error running exec in container: %v\n", err) + stdout.Write([]byte(err.Error() + "\r\n")) + logrus.Errorf("Error running exec in container: %v", err) } return nil }