Close stdout/stderr fifo as soon as possible
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com> Upstream-commit: 5a6184a535b62d9b5515d18d8561641d3f3d04cb Component: engine
This commit is contained in:
@ -113,12 +113,13 @@ func (c *Config) CloseStreams() error {
|
||||
|
||||
// CopyToPipe connects streamconfig with a 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)
|
||||
go func() {
|
||||
if _, err := pools.Copy(w, r); err != nil {
|
||||
logrus.Errorf("stream copy error: %+v", err)
|
||||
}
|
||||
r.Close()
|
||||
c.Done()
|
||||
}()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user