Prechádzať zdrojové kódy

platform_linux.set_flags: don't raise on EOPNOTSUPP

Marian Beermann 9 rokov pred
rodič
commit
ed6f6b9aac
1 zmenil súbory, kde vykonal 2 pridanie a 4 odobranie
  1. 2 4
      borg/platform_linux.pyx

+ 2 - 4
borg/platform_linux.pyx

@@ -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)