For PR797:

Remove exceptions from the Path::create*OnDisk methods. Update their users
to handle error messages via arguments and result codes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29840 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Reid Spencer
2006-08-23 00:39:35 +00:00
parent b590a75eb5
commit e5c9cb5eb6
7 changed files with 71 additions and 47 deletions

View File

@ -389,7 +389,8 @@ Archive::writeToDisk(bool CreateSymbolTable, bool TruncateNames, bool Compress,
// Create a temporary file to store the archive in
sys::Path TmpArchive = archPath;
TmpArchive.createTemporaryFileOnDisk();
if (TmpArchive.createTemporaryFileOnDisk(error))
return false;
// Make sure the temporary gets removed if we crash
sys::RemoveFileOnSignal(TmpArchive);
@ -452,7 +453,8 @@ Archive::writeToDisk(bool CreateSymbolTable, bool TruncateNames, bool Compress,
// Open another temporary file in order to avoid invalidating the
// mmapped data
sys::Path FinalFilePath = archPath;
FinalFilePath.createTemporaryFileOnDisk();
if (FinalFilePath.createTemporaryFileOnDisk(error))
return false;
sys::RemoveFileOnSignal(FinalFilePath);
std::ofstream FinalFile(FinalFilePath.c_str(), io_mode);