1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2025-01-01 12:45:34 +00:00

Merge pull request #1184 from c4rlo/linux-syncfile-errno-fix

platform.linux: small SyncFile error handling fix
This commit is contained in:
TW 2016-06-18 14:49:18 +02:00 committed by GitHub
commit d9a14e3658

View file

@ -214,7 +214,7 @@ cdef _sync_file_range(fd, offset, length, flags):
assert offset & PAGE_MASK == 0, "offset %d not page-aligned" % offset
assert length & PAGE_MASK == 0, "length %d not page-aligned" % length
if sync_file_range(fd, offset, length, flags) != 0:
raise OSError(errno, os.strerror(errno))
raise OSError(errno.errno, os.strerror(errno.errno))
os.posix_fadvise(fd, offset, length, os.POSIX_FADV_DONTNEED)
cdef unsigned PAGE_MASK = resource.getpagesize() - 1