mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #8672 from estesp/CmdRun-fix-typos-comments
Clean up comment sections and fix typos in CmdRun
This commit is contained in:
commit
25c32d3167
1 changed files with 9 additions and 9 deletions
|
@ -2195,7 +2195,7 @@ func (cli *DockerCli) CmdRun(args ...string) error {
|
||||||
config.StdinOnce = false
|
config.StdinOnce = false
|
||||||
}
|
}
|
||||||
|
|
||||||
// Disable flSigProxy in case on TTY
|
// Disable flSigProxy when in TTY mode
|
||||||
sigProxy := *flSigProxy
|
sigProxy := *flSigProxy
|
||||||
if config.Tty {
|
if config.Tty {
|
||||||
sigProxy = false
|
sigProxy = false
|
||||||
|
@ -2217,7 +2217,7 @@ func (cli *DockerCli) CmdRun(args ...string) error {
|
||||||
)
|
)
|
||||||
|
|
||||||
if !config.AttachStdout && !config.AttachStderr {
|
if !config.AttachStdout && !config.AttachStderr {
|
||||||
// Make this asynchrone in order to let the client write to stdin before having to read the ID
|
// Make this asynchronous to allow the client to write to stdin before having to read the ID
|
||||||
waitDisplayId = make(chan struct{})
|
waitDisplayId = make(chan struct{})
|
||||||
go func() {
|
go func() {
|
||||||
defer close(waitDisplayId)
|
defer close(waitDisplayId)
|
||||||
|
@ -2229,7 +2229,7 @@ func (cli *DockerCli) CmdRun(args ...string) error {
|
||||||
return ErrConflictRestartPolicyAndAutoRemove
|
return ErrConflictRestartPolicyAndAutoRemove
|
||||||
}
|
}
|
||||||
|
|
||||||
// We need to instanciate the chan because the select needs it. It can
|
// We need to instantiate the chan because the select needs it. It can
|
||||||
// be closed but can't be uninitialized.
|
// be closed but can't be uninitialized.
|
||||||
hijacked := make(chan io.Closer)
|
hijacked := make(chan io.Closer)
|
||||||
|
|
||||||
|
@ -2276,8 +2276,8 @@ func (cli *DockerCli) CmdRun(args ...string) error {
|
||||||
// Acknowledge the hijack before starting
|
// Acknowledge the hijack before starting
|
||||||
select {
|
select {
|
||||||
case closer := <-hijacked:
|
case closer := <-hijacked:
|
||||||
// Make sure that hijack gets closed when returning. (result
|
// Make sure that the hijack gets closed when returning (results
|
||||||
// in closing hijack chan and freeing server's goroutines.
|
// in closing the hijack chan and freeing server's goroutines)
|
||||||
if closer != nil {
|
if closer != nil {
|
||||||
defer closer.Close()
|
defer closer.Close()
|
||||||
}
|
}
|
||||||
|
@ -2329,15 +2329,15 @@ func (cli *DockerCli) CmdRun(args ...string) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
// No Autoremove: Simply retrieve the exit code
|
||||||
if !config.Tty {
|
if !config.Tty {
|
||||||
// In non-tty mode, we can't dettach, so we know we need to wait.
|
// In non-TTY mode, we can't detach, so we must wait for container exit
|
||||||
if status, err = waitForExit(cli, runResult.Get("Id")); err != nil {
|
if status, err = waitForExit(cli, runResult.Get("Id")); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// In TTY mode, there is a race. If the process dies too slowly, the state can be update after the getExitCode call
|
// In TTY mode, there is a race: if the process dies too slowly, the state could
|
||||||
// and result in a wrong exit code.
|
// be updated after the getExitCode call and result in the wrong exit code being reported
|
||||||
// No Autoremove: Simply retrieve the exit code
|
|
||||||
if _, status, err = getExitCode(cli, runResult.Get("Id")); err != nil {
|
if _, status, err = getExitCode(cli, runResult.Get("Id")); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue