Changeset 1921

Show
Ignore:
Timestamp:
04/11/2007 16:34:41 (14 months ago)
Author:
chris
Message:

Really fix unlink() during restore, fixes [1919].

Files:
1 modified

Legend:

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

    r1919 r1921  
    454454                                std::string localFilename(rLocalDirectoryName + DIRECTORY_SEPARATOR_ASCHAR + nm.GetClearFilename()); 
    455455                                 
    456                                 // Unlink anything which already exists -- for resuming restores, we can't overwrite files already there. 
    457                                 if(::unlink(localFilename.c_str()) != 0) 
     456                                // Unlink anything which already exists: 
     457                                // For resuming restores, we can't overwrite 
     458                                // files already there. 
     459                                if(ObjectExists(localFilename) != ObjectExists_NoObject && 
     460                                        ::unlink(localFilename.c_str()) != 0) 
    458461                                { 
    459462                                        BOX_ERROR("Failed to delete file '" <<