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:
parent
ffa78161cd
commit
ed6f6b9aac
1 changed files with 2 additions and 4 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue