mirror of
https://github.com/clearlinux/docker.git
synced 2026-09-04 12:41:42 +00:00
fix a panic when the exec fails to start
Signed-off-by: Shijiang Wei <mountkin@gmail.com>
This commit is contained in:
+4
-2
@@ -65,7 +65,7 @@ func (s *Server) postContainerExecStart(version version.Version, w http.Response
|
||||
}
|
||||
var (
|
||||
execName = vars["name"]
|
||||
stdin io.ReadCloser
|
||||
stdin, inStream io.ReadCloser
|
||||
stdout, stderr, outStream io.Writer
|
||||
)
|
||||
|
||||
@@ -77,7 +77,7 @@ func (s *Server) postContainerExecStart(version version.Version, w http.Response
|
||||
if !execStartCheck.Detach {
|
||||
var err error
|
||||
// Setting up the streaming http interface.
|
||||
inStream, outStream, err := hijackServer(w)
|
||||
inStream, outStream, err = hijackServer(w)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -95,6 +95,8 @@ func (s *Server) postContainerExecStart(version version.Version, w http.Response
|
||||
stderr = stdcopy.NewStdWriter(outStream, stdcopy.Stderr)
|
||||
stdout = stdcopy.NewStdWriter(outStream, stdcopy.Stdout)
|
||||
}
|
||||
} else {
|
||||
outStream = w
|
||||
}
|
||||
|
||||
// Now run the user process in container.
|
||||
|
||||
Reference in New Issue
Block a user