Handle error during copy of original content

Signed-off-by: Sylvain Baubeau <sbaubeau@redhat.com>
This commit is contained in:
Sylvain Baubeau 2015-05-29 15:46:12 +02:00
parent 9f7f23e373
commit 16a49ade16

View file

@ -343,7 +343,9 @@ func (d *driver) WriteStream(ctx context.Context, path string, offset int64, rea
if err != nil { if err != nil {
return bytesRead, parseError(path, err) return bytesRead, parseError(path, err)
} }
io.Copy(currentSegment, file) if _, err := io.Copy(currentSegment, file); err != nil {
return bytesRead, parseError(path, err)
}
file.Close() file.Close()
} }
if n > 0 { if n > 0 {