1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2024-12-25 01:06:50 +00:00

platform_linux.set_flags: don't raise on EOPNOTSUPP

This commit is contained in:
Marian Beermann 2016-05-22 17:34:58 +02:00
parent ffa78161cd
commit ed6f6b9aac
No known key found for this signature in database
GPG key ID: 9B8450B91D1362C1

View file

@ -50,9 +50,6 @@ cdef extern from "linux/fs.h":
cdef extern from "stropts.h":
int ioctl(int fildes, int request, ...)
cdef extern from "errno.h":
int errno
cdef extern from "string.h":
char *strerror(int errnum)
@ -79,7 +76,8 @@ 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:
raise OSError(errno, strerror(errno).decode(), path)
if errno.errno != errno.EOPNOTSUPP:
raise OSError(errno, strerror(errno).decode(), path)
finally:
if open_fd:
os.close(fd)