Changeset 2986


Ignore:
Timestamp:
28/08/2011 16:37:31 (9 months ago)
Author:
chris
Message:

Fix incorrect "conversion failed" message when logging NULL VSS parameter.

Fix log level of VSS component type to TRACE instead of INFO.

Fix VSS path generation for absolute paths including drive letters.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • box/trunk/bin/bbackupd/BackupDaemon.cpp

    r2983 r2986  
    119119                std::string WideStringToString(WCHAR *buf) 
    120120                { 
     121                        if (buf == NULL) 
     122                        { 
     123                                return "(null)"; 
     124                        } 
     125 
    121126                        char* pStr = ConvertFromWideString(buf, CP_UTF8); 
    122127                         
    123128                        if(pStr == NULL) 
    124129                        { 
    125                                 return "conversion failed"; 
     130                                return "(conversion failed)"; 
    126131                        } 
    127132                         
     
    12511256                        switch(pComponentInfo->type) 
    12521257                        { 
    1253                         case VSS_CT_UNDEFINED: BOX_INFO("VSS: type: undefined"); break; 
    1254                         case VSS_CT_DATABASE:  BOX_INFO("VSS: type: database"); break; 
    1255                         case VSS_CT_FILEGROUP: BOX_INFO("VSS: type: filegroup"); break; 
     1258                        case VSS_CT_UNDEFINED: BOX_TRACE("VSS: type: undefined"); break; 
     1259                        case VSS_CT_DATABASE:  BOX_TRACE("VSS: type: database"); break; 
     1260                        case VSS_CT_FILEGROUP: BOX_TRACE("VSS: type: filegroup"); break; 
    12561261                        default: 
    12571262                                BOX_WARNING("VSS: type: unknown (" << pComponentInfo->type << ")"); 
     
    13351340                                        rLocation.mSnapshotVolumeId = newVolumeId; 
    13361341                                        rLocation.mIsSnapshotCreated = true; 
     1342 
     1343                                        // If the snapshot path starts with the volume root 
     1344                                        // (drive letter), because the path is absolute (as 
     1345                                        // it should be), then remove it so that the 
     1346                                        // resulting snapshot path can be appended to the 
     1347                                        // snapshot device object to make a real path, 
     1348                                        // without a spurious drive letter in it. 
     1349 
     1350                                        if (path.substr(0, volumeRoot.length()) == volumeRoot) 
     1351                                        { 
     1352                                                path = path.substr(volumeRoot.length()); 
     1353                                        } 
     1354 
    13371355                                        rLocation.mSnapshotPath = path; 
    13381356                                } 
Note: See TracChangeset for help on using the changeset viewer.