mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-12 13:38:21 +00:00
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:
@ -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);
|
||||
|
Reference in New Issue
Block a user