зеркало из https://github.com/microsoft/docker.git
Make sure to close the pipe upon ctrl-d
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)
This commit is contained in:
Родитель
1a4fb09219
Коммит
66baa0653b
|
@ -99,7 +99,10 @@ func execCommand(container *libcontainer.Container, tty bool, args []string) (in
|
|||
}
|
||||
defer term.RestoreTerminal(os.Stdin.Fd(), state)
|
||||
} else {
|
||||
go io.Copy(inPipe, os.Stdin)
|
||||
go func() {
|
||||
defer inPipe.Close()
|
||||
io.Copy(inPipe, os.Stdin)
|
||||
}()
|
||||
go io.Copy(os.Stdout, outPipe)
|
||||
go io.Copy(os.Stderr, errPipe)
|
||||
}
|
||||
|
@ -109,6 +112,7 @@ func execCommand(container *libcontainer.Container, tty bool, args []string) (in
|
|||
return -1, err
|
||||
}
|
||||
}
|
||||
|
||||
return command.ProcessState.Sys().(syscall.WaitStatus).ExitStatus(), nil
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче