Merge pull request #8334 from davidhsingyuchen/fix-io-cancel

fix: cio.Cancel() should close the pipes
This commit is contained in:
Kazuyoshi Kato 2023-05-31 09:58:36 -07:00 committed by GitHub
commit 9e834e761a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -98,7 +98,14 @@ func copyIO(fifos *FIFOSet, ioset *Streams) (*cio, error) {
config: fifos.Config,
wg: wg,
closers: append(pipes.closers(), fifos),
cancel: cancel,
cancel: func() {
cancel()
for _, c := range pipes.closers() {
if c != nil {
c.Close()
}
}
},
}, nil
}