Changeset 3032 for box/trunk/bin


Ignore:
Timestamp:
25/10/2011 23:57:35 (7 months ago)
Author:
chris
Message:

Delete any incomplete ID map database that we find, so that we can start
afresh with a new one, should solve most corrupt database errors such as
the ones reported by Achim.

File:
1 edited

Legend:

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

    r2992 r3032  
    25152515                        } 
    25162516 
     2517                        // The new map file should not exist yet. If there's 
     2518                        // one left over from a previous failed run, it's not 
     2519                        // useful to us because we never read from it and will 
     2520                        // overwrite the entries of all files that still 
     2521                        // exist, so we should just delete it and start afresh. 
     2522                        if(NewMaps && FileExists(filename.c_str())) 
     2523                        { 
     2524                                BOX_NOTICE("Found an incomplete ID map " 
     2525                                        "database, deleting it to start " 
     2526                                        "afresh: " << filename); 
     2527                                if(unlink(filename.c_str()) != 0) 
     2528                                { 
     2529                                        BOX_LOG_NATIVE_ERROR(BOX_FILE_MESSAGE( 
     2530                                                filename, "Failed to delete " 
     2531                                                "incomplete ID map database")); 
     2532                                } 
     2533                        } 
     2534 
    25172535                        // If it's not a new map, it may not exist in which case an empty map should be created 
    25182536                        if(!NewMaps && !FileExists(filename.c_str())) 
Note: See TracChangeset for help on using the changeset viewer.