mirror of https://github.com/docker/docs.git
Merge pull request #21193 from amitkris/flush_fix
Remove flush(stdout) in pkg/chrootarchive/diff_unix.go
This commit is contained in:
commit
6852d87659
|
@ -46,7 +46,10 @@ func untar() {
|
||||||
fatal(err)
|
fatal(err)
|
||||||
}
|
}
|
||||||
// fully consume stdin in case it is zero padded
|
// fully consume stdin in case it is zero padded
|
||||||
flush(os.Stdin)
|
if _, err := flush(os.Stdin); err != nil {
|
||||||
|
fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -65,8 +65,10 @@ func applyLayer() {
|
||||||
fatal(fmt.Errorf("unable to encode layerSize JSON: %s", err))
|
fatal(fmt.Errorf("unable to encode layerSize JSON: %s", err))
|
||||||
}
|
}
|
||||||
|
|
||||||
flush(os.Stdout)
|
if _, err := flush(os.Stdin); err != nil {
|
||||||
flush(os.Stdin)
|
fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,6 @@ func fatal(err error) {
|
||||||
|
|
||||||
// flush consumes all the bytes from the reader discarding
|
// flush consumes all the bytes from the reader discarding
|
||||||
// any errors
|
// any errors
|
||||||
func flush(r io.Reader) {
|
func flush(r io.Reader) (bytes int64, err error) {
|
||||||
io.Copy(ioutil.Discard, r)
|
return io.Copy(ioutil.Discard, r)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue