Ignore:
Timestamp:
18/02/2010 14:59:47 (2 years ago)
Author:
chris
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • box/trunk/lib/backupclient/BackupClientFileAttributes.cpp

    r2614 r2618  
    260260        COMPARE(UserDefinedFlags, "User-defined flags"); 
    261261        COMPARE(Mode, "Modes"); 
    262          
     262 
    263263        if(!IgnoreModTime) 
    264264        { 
    265                 uint64_t t1 = box_ntoh64(a1->ModificationTime) / 1000000; 
    266                 uint64_t t2 = box_ntoh64(a2->ModificationTime) / 1000000; 
    267                 if(t1 != t2) 
     265                uint64_t t1 = box_ntoh64(a1->ModificationTime); 
     266                uint64_t t2 = box_ntoh64(a2->ModificationTime); 
     267                time_t s1 = BoxTimeToSeconds(t1); 
     268                time_t s2 = BoxTimeToSeconds(t2); 
     269                if(s1 != s2) 
    268270                { 
    269271                        BOX_TRACE("Attribute Compare: File modification " 
    270                                 "times differ: local " << t1 << ", " 
    271                                 "remote " << t2); 
     272                                "times differ: local " << 
     273                                FormatTime(t1, true) << " (" << s1 << "), " 
     274                                "remote " << 
     275                                FormatTime(t2, true) << " (" << s2 << ")"); 
    272276                        return false; 
    273277                } 
    274278        } 
    275  
     279         
    276280        if(!IgnoreAttrModTime) 
    277281        { 
    278                 uint64_t t1 = box_ntoh64(a1->AttrModificationTime) / 1000000; 
    279                 uint64_t t2 = box_ntoh64(a2->AttrModificationTime) / 1000000; 
    280                 if(t1 != t2) 
     282                uint64_t t1 = box_ntoh64(a1->AttrModificationTime); 
     283                uint64_t t2 = box_ntoh64(a2->AttrModificationTime); 
     284                time_t s1 = BoxTimeToSeconds(t1); 
     285                time_t s2 = BoxTimeToSeconds(t2); 
     286                if(s1 != s2) 
    281287                { 
    282288                        BOX_TRACE("Attribute Compare: Attribute modification " 
    283                                 "times differ: local " << t1 << ", " 
    284                                 "remote " << t2); 
     289                                "times differ: local " << 
     290                                FormatTime(t1, true) << " (" << s1 << "), " 
     291                                "remote " << 
     292                                FormatTime(t2, true) << " (" << s2 << ")"); 
    285293                        return false; 
    286294                } 
Note: See TracChangeset for help on using the changeset viewer.