mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-26 15:32:30 +00:00
Merge pull request #7761 from jepio/iocopy-fix-race
runtime: Fix data race in ioCopy
This commit is contained in:
commit
bde06758b1
@ -126,11 +126,11 @@ func ioCopy(shimLog *logrus.Entry, exitch, stdinCloser chan struct{}, tty *ttyIO
|
||||
p := bufPool.Get().(*[]byte)
|
||||
defer bufPool.Put(p)
|
||||
io.CopyBuffer(tty.io.Stdout(), stdoutPipe, *p)
|
||||
wg.Done()
|
||||
if tty.io.Stdin() != nil {
|
||||
// close stdin to make the other routine stop
|
||||
tty.io.Stdin().Close()
|
||||
}
|
||||
wg.Done()
|
||||
shimLog.Debug("stdout io stream copy exited")
|
||||
}()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user