mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Close stdout/stderr fifo as soon as possible
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
parent
c38bb7a725
commit
5a6184a535
1 changed files with 2 additions and 1 deletions
|
@ -113,12 +113,13 @@ func (c *Config) CloseStreams() error {
|
||||||
|
|
||||||
// CopyToPipe connects streamconfig with a libcontainerd.IOPipe
|
// CopyToPipe connects streamconfig with a libcontainerd.IOPipe
|
||||||
func (c *Config) CopyToPipe(iop libcontainerd.IOPipe) {
|
func (c *Config) CopyToPipe(iop libcontainerd.IOPipe) {
|
||||||
copyFunc := func(w io.Writer, r io.Reader) {
|
copyFunc := func(w io.Writer, r io.ReadCloser) {
|
||||||
c.Add(1)
|
c.Add(1)
|
||||||
go func() {
|
go func() {
|
||||||
if _, err := pools.Copy(w, r); err != nil {
|
if _, err := pools.Copy(w, r); err != nil {
|
||||||
logrus.Errorf("stream copy error: %+v", err)
|
logrus.Errorf("stream copy error: %+v", err)
|
||||||
}
|
}
|
||||||
|
r.Close()
|
||||||
c.Done()
|
c.Done()
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue