]> git.michaelhowe.org Git - packages/b/bup.git/commitdiff
lib/bup/drecurse.py: work even if O_NOFOLLOW is missing.
authorAvery Pennarun <apenwarr@gmail.com>
Wed, 26 Jan 2011 03:04:18 +0000 (19:04 -0800)
committerAvery Pennarun <apenwarr@gmail.com>
Wed, 26 Jan 2011 03:04:18 +0000 (19:04 -0800)
It's non-critical and appears to be missing on Solaris.  Thanks to Henning
Mueller for reporting the problem.

Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
lib/bup/drecurse.py

index de180bc5af75d65aae2538e893b6d4f72c4d7714..4196dec0faabb6377db279892c956cf0cb437826 100644 (file)
@@ -5,6 +5,10 @@ try:
     O_LARGEFILE = os.O_LARGEFILE
 except AttributeError:
     O_LARGEFILE = 0
+try:
+    O_NOFOLLOW = os.O_NOFOLLOW
+except AttributeError:
+    O_NOFOLLOW = 0
 
 
 # the use of fchdir() and lstat() is for two reasons:
@@ -13,8 +17,7 @@ except AttributeError:
 class OsFile:
     def __init__(self, path):
         self.fd = None
-        self.fd = os.open(path, 
-                          os.O_RDONLY|O_LARGEFILE|os.O_NOFOLLOW|os.O_NDELAY)
+        self.fd = os.open(path, os.O_RDONLY|O_LARGEFILE|O_NOFOLLOW|os.O_NDELAY)
         
     def __del__(self):
         if self.fd: