1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Activate Config.StdinOnce at argument parsing

This commit is contained in:
Solomon Hykes 2013-04-02 11:02:19 -07:00
parent 8f9e454241
commit aea2675f7b
2 changed files with 4 additions and 1 deletions

View file

@ -874,7 +874,6 @@ func (srv *Server) CmdRun(stdin io.ReadCloser, stdout io.Writer, args ...string)
if !config.Detach {
var attachErr chan error
if config.OpenStdin {
config.StdinOnce = true
Debugf("Attaching with stdin\n")
attachErr = container.Attach(stdin, stdout, stdout)
} else {

View file

@ -101,6 +101,10 @@ func ParseRun(args []string, stdout io.Writer) (*Config, error) {
Cmd: runCmd,
Image: image,
}
// When allocating stdin in attached mode, close stdin at client disconnect
if config.OpenStdin && !config.Detach {
config.StdinOnce = true
}
return config, nil
}