mirror of
https://github.com/ValveSoftware/Proton.git
synced 2024-12-27 23:25:50 +03:00
proton: Don't use copy_file_range if fs doesn't support it.
This commit is contained in:
parent
bd8d7e374e
commit
c17db0b838
4
proton
4
proton
@ -229,9 +229,9 @@ def copyfile_reflink(srcname, dstname):
|
|||||||
while bytes_to_copy > 0:
|
while bytes_to_copy > 0:
|
||||||
bytes_to_copy -= copy_file_range(src.fileno(), dst.fileno(), bytes_to_copy)
|
bytes_to_copy -= copy_file_range(src.fileno(), dst.fileno(), bytes_to_copy)
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
if e.errno not in (errno.EXDEV, errno.ENOSYS, errno.EINVAL):
|
if e.errno not in (errno.EXDEV, errno.ENOSYS, errno.EINVAL, errno.EOPNOTSUPP):
|
||||||
raise e
|
raise e
|
||||||
if e.errno == errno.ENOSYS:
|
if e.errno == errno.ENOSYS or e.errno == errno.EOPNOTSUPP:
|
||||||
copyfile = shutil.copyfile
|
copyfile = shutil.copyfile
|
||||||
shutil.copyfile(srcname, dstname)
|
shutil.copyfile(srcname, dstname)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user