From 9e2b6cb14c6774d646515da2ab186d4968af17df Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 18 Feb 2010 14:59:47 +0000 Subject: 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. --- lib/backupclient/BackupClientFileAttributes.cpp | 32 +++++++++++++++---------- 1 file changed, 20 insertions(+), 12 deletions(-) (limited to 'lib/backupclient') 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; } } -- cgit v1.2.3