Fix file_copy_sparse when file ends with hole
This commit is contained in:
parent
51f062b925
commit
c8172f27b3
8
vmmd
8
vmmd
|
@ -2210,7 +2210,13 @@ def acp_sparse(srcfile, dstfile, file_size):
|
|||
off = 0
|
||||
pct = 0
|
||||
while off < file_size:
|
||||
off = srcfile.seek(off, os.SEEK_DATA)
|
||||
try:
|
||||
off = srcfile.seek(off, os.SEEK_DATA)
|
||||
except OSError as e:
|
||||
if e.errno == errno.ENXIO:
|
||||
dstfile.truncate(file_size)
|
||||
return
|
||||
raise
|
||||
end = srcfile.seek(off, os.SEEK_HOLE)
|
||||
srcfile.seek(off)
|
||||
dstfile.seek(off)
|
||||
|
|
Loading…
Reference in New Issue