diff options
Diffstat (limited to 'lib/Bytecode/Archive')
-rw-r--r-- | lib/Bytecode/Archive/ArchiveWriter.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Bytecode/Archive/ArchiveWriter.cpp b/lib/Bytecode/Archive/ArchiveWriter.cpp index c99d851..c3fda5f 100644 --- a/lib/Bytecode/Archive/ArchiveWriter.cpp +++ b/lib/Bytecode/Archive/ArchiveWriter.cpp @@ -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); |