diff options
author | Chris Wilson <chris+github@qwirx.com> | 2010-02-18 14:59:47 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2010-02-18 14:59:47 +0000 |
commit | 9e2b6cb14c6774d646515da2ab186d4968af17df (patch) | |
tree | 54d7d1ca3569e53a1ba8f61617408658c50e7ffc | |
parent | a0b19b13d840275c945cd5c19b0096b3cc008b60 (diff) |
Log the mismatched timestamps of files during compare in a human-readable
format as well as the raw numbers.
Use existing helper functions to convert box_time_t to seconds, rather than
just arbitrarily dividing by 1000000.
-rw-r--r-- | lib/backupclient/BackupClientFileAttributes.cpp | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/lib/backupclient/BackupClientFileAttributes.cpp b/lib/backupclient/BackupClientFileAttributes.cpp index d06726f6..b3fb33a4 100644 --- a/lib/backupclient/BackupClientFileAttributes.cpp +++ b/lib/backupclient/BackupClientFileAttributes.cpp @@ -259,29 +259,37 @@ bool BackupClientFileAttributes::Compare(const BackupClientFileAttributes &rAttr COMPARE(GID, "GIDs"); COMPARE(UserDefinedFlags, "User-defined flags"); COMPARE(Mode, "Modes"); - + if(!IgnoreModTime) { - uint64_t t1 = box_ntoh64(a1->ModificationTime) / 1000000; - uint64_t t2 = box_ntoh64(a2->ModificationTime) / 1000000; - if(t1 != t2) + uint64_t t1 = box_ntoh64(a1->ModificationTime); + uint64_t t2 = box_ntoh64(a2->ModificationTime); + time_t s1 = BoxTimeToSeconds(t1); + time_t s2 = BoxTimeToSeconds(t2); + if(s1 != s2) { BOX_TRACE("Attribute Compare: File modification " - "times differ: local " << t1 << ", " - "remote " << t2); + "times differ: local " << + FormatTime(t1, true) << " (" << s1 << "), " + "remote " << + FormatTime(t2, true) << " (" << s2 << ")"); return false; } } - + if(!IgnoreAttrModTime) { - uint64_t t1 = box_ntoh64(a1->AttrModificationTime) / 1000000; - uint64_t t2 = box_ntoh64(a2->AttrModificationTime) / 1000000; - if(t1 != t2) + uint64_t t1 = box_ntoh64(a1->AttrModificationTime); + uint64_t t2 = box_ntoh64(a2->AttrModificationTime); + time_t s1 = BoxTimeToSeconds(t1); + time_t s2 = BoxTimeToSeconds(t2); + if(s1 != s2) { BOX_TRACE("Attribute Compare: Attribute modification " - "times differ: local " << t1 << ", " - "remote " << t2); + "times differ: local " << + FormatTime(t1, true) << " (" << s1 << "), " + "remote " << + FormatTime(t2, true) << " (" << s2 << ")"); return false; } } |