From: Avery Pennarun Date: Wed, 26 Jan 2011 03:04:18 +0000 (-0800) Subject: lib/bup/drecurse.py: work even if O_NOFOLLOW is missing. X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=e11acd1375783ac80599ca540688c8e871cbffa4;p=packages%2Fb%2Fbup.git lib/bup/drecurse.py: work even if O_NOFOLLOW is missing. It's non-critical and appears to be missing on Solaris. Thanks to Henning Mueller for reporting the problem. Signed-off-by: Avery Pennarun --- diff --git a/lib/bup/drecurse.py b/lib/bup/drecurse.py index de180bc..4196dec 100644 --- a/lib/bup/drecurse.py +++ b/lib/bup/drecurse.py @@ -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: