1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2024-12-24 00:37:56 +00:00

Fix referencing error in platform_linux.set_flags

This commit is contained in:
Marian Beermann 2016-05-22 19:54:08 +02:00
parent ec90f9ae57
commit cdb8cc5490
No known key found for this signature in database
GPG key ID: 9B8450B91D1362C1

View file

@ -76,8 +76,9 @@ def set_flags(path, bsd_flags, fd=None):
fd = os.open(path, os.O_RDONLY|os.O_NONBLOCK|os.O_NOFOLLOW)
try:
if ioctl(fd, FS_IOC_SETFLAGS, &flags) == -1:
if errno.errno != errno.EOPNOTSUPP:
raise OSError(errno, strerror(errno).decode(), path)
error_number = errno.errno
if error_number != errno.EOPNOTSUPP:
raise OSError(error_number, strerror(error_number).decode(), path)
finally:
if open_fd:
os.close(fd)