ioutils: fix race in access closeErr in bytespipe
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
This commit is contained in:
parent
7ee212504d
commit
a6496e5b41
1 changed files with 2 additions and 1 deletions
|
@ -133,8 +133,9 @@ func (bp *BytesPipe) Read(p []byte) (n int, err error) {
|
|||
}
|
||||
bp.wait.Wait()
|
||||
if bp.bufLen == 0 && bp.closeErr != nil {
|
||||
err := bp.closeErr
|
||||
bp.mu.Unlock()
|
||||
return 0, bp.closeErr
|
||||
return 0, err
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue