]> arthur.barton.de Git - bup.git/commitdiff
Use *native* type sizes in file attr guard
authorRob Browning <rlb@defaultvalue.org>
Sun, 15 Mar 2015 15:34:38 +0000 (10:34 -0500)
committerRob Browning <rlb@defaultvalue.org>
Sun, 15 Mar 2015 15:35:02 +0000 (10:35 -0500)
I'd misunderstood what Python struct meant by the *standard* size, and
what I'd wanted in the guard was the native size, so ask for that (via
'@').

Thanks to Robert Edmunds for running a build through the Debian buildds
and then reporting the problem that revealed on s390x.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
lib/bup/metadata.py

index 8a84f11747e1ca6725275683f8b736501eebc8af..390c5acd0b3fea214d8ffa5e55374440ebff679e 100644 (file)
@@ -44,8 +44,9 @@ except ImportError:
     get_linux_file_attr = set_linux_file_attr = None
 
 
+# See the bup_get_linux_file_attr() comments.
 _suppress_linux_file_attr = \
-    sys.byteorder == 'big' and struct.calcsize('=l') > struct.calcsize('=i')
+    sys.byteorder == 'big' and struct.calcsize('@l') > struct.calcsize('@i')
 
 def check_linux_file_attr_api():
     global get_linux_file_attr, set_linux_file_attr