Modify Path::eraseFromDisk to not throw an exception.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29400 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2006-07-28 22:29:50 +00:00
parent 65a392ebea
commit 0c33231eff
6 changed files with 58 additions and 58 deletions

View File

@@ -396,7 +396,7 @@ Archive::writeToDisk(bool CreateSymbolTable, bool TruncateNames, bool Compress,
std::ofstream ArchiveFile(TmpArchive.c_str(), io_mode);
// Check for errors opening or creating archive file.
if ( !ArchiveFile.is_open() || ArchiveFile.bad() ) {
if (!ArchiveFile.is_open() || ArchiveFile.bad()) {
if (TmpArchive.exists())
TmpArchive.eraseFromDisk();
if (error)
@@ -415,10 +415,9 @@ Archive::writeToDisk(bool CreateSymbolTable, bool TruncateNames, bool Compress,
// Loop over all member files, and write them out. Note that this also
// builds the symbol table, symTab.
for ( MembersList::iterator I = begin(), E = end(); I != E; ++I) {
if (!writeMember(*I,ArchiveFile,CreateSymbolTable,
TruncateNames,Compress,error))
{
for (MembersList::iterator I = begin(), E = end(); I != E; ++I) {
if (!writeMember(*I, ArchiveFile, CreateSymbolTable,
TruncateNames, Compress, error)) {
if (TmpArchive.exists())
TmpArchive.eraseFromDisk();
ArchiveFile.close();
@@ -448,7 +447,7 @@ Archive::writeToDisk(bool CreateSymbolTable, bool TruncateNames, bool Compress,
sys::RemoveFileOnSignal(FinalFilePath);
std::ofstream FinalFile(FinalFilePath.c_str(), io_mode);
if ( !FinalFile.is_open() || FinalFile.bad() ) {
if (!FinalFile.is_open() || FinalFile.bad()) {
if (TmpArchive.exists())
TmpArchive.eraseFromDisk();
if (error)