diff options
author | Chris Wilson <chris+github@qwirx.com> | 2010-02-16 23:07:11 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2010-02-16 23:07:11 +0000 |
commit | 4bd8a2033bee1f7d110d54b4fc2b275fe2df0567 (patch) | |
tree | 252cdfe3efbe76ed41e86d287b2ad32d6840141e /lib/backupclient | |
parent | d7409d428b372a9458981a9bbde3223238e68436 (diff) |
Convert attributes to host byte order when reporting errors.
Convert timestamps to host byte order before dividing from usecs to secs,
store in uint64_t variables to avoid truncation, and display in host byte
order.
Diffstat (limited to 'lib/backupclient')
-rw-r--r-- | lib/backupclient/BackupClientFileAttributes.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/backupclient/BackupClientFileAttributes.cpp b/lib/backupclient/BackupClientFileAttributes.cpp index 39ffc741..d06726f6 100644 --- a/lib/backupclient/BackupClientFileAttributes.cpp +++ b/lib/backupclient/BackupClientFileAttributes.cpp @@ -250,8 +250,8 @@ bool BackupClientFileAttributes::Compare(const BackupClientFileAttributes &rAttr if (a1->attribute != a2->attribute) \ { \ BOX_TRACE("Attribute Compare: " << message << " differ: " \ - "local " << a1->attribute << ", " \ - "remote " << a2->attribute); \ + "local " << ntoh(a1->attribute) << ", " \ + "remote " << ntoh(a2->attribute)); \ return false; \ } COMPARE(AttributeType, "Attribute types"); @@ -262,8 +262,8 @@ bool BackupClientFileAttributes::Compare(const BackupClientFileAttributes &rAttr if(!IgnoreModTime) { - int t1 = a1->ModificationTime / 1000000; - int t2 = a2->ModificationTime / 1000000; + uint64_t t1 = box_ntoh64(a1->ModificationTime) / 1000000; + uint64_t t2 = box_ntoh64(a2->ModificationTime) / 1000000; if(t1 != t2) { BOX_TRACE("Attribute Compare: File modification " @@ -275,8 +275,8 @@ bool BackupClientFileAttributes::Compare(const BackupClientFileAttributes &rAttr if(!IgnoreAttrModTime) { - int t1 = a1->AttrModificationTime / 1000000; - int t2 = a2->AttrModificationTime / 1000000; + uint64_t t1 = box_ntoh64(a1->AttrModificationTime) / 1000000; + uint64_t t2 = box_ntoh64(a2->AttrModificationTime) / 1000000; if(t1 != t2) { BOX_TRACE("Attribute Compare: Attribute modification " @@ -299,7 +299,7 @@ bool BackupClientFileAttributes::Compare(const BackupClientFileAttributes &rAttr std::string s2((char *)(a2 + 1), datalen); BOX_TRACE("Attribute Compare: Symbolic link target " "or extended attributes differ: " - "local " << PrintEscapedBinaryData(s1) << ", " + "local " << PrintEscapedBinaryData(s1) << ", " "remote " << PrintEscapedBinaryData(s2)); return false; } |