From e5c9cb5eb6bce502faaedea04014dab46f6540f4 Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Wed, 23 Aug 2006 00:39:35 +0000 Subject: 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 --- lib/Archive/ArchiveWriter.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/Archive/ArchiveWriter.cpp') diff --git a/lib/Archive/ArchiveWriter.cpp b/lib/Archive/ArchiveWriter.cpp index c99d8510c5..c3fda5fe1a 100644 --- a/lib/Archive/ArchiveWriter.cpp +++ b/lib/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); -- cgit v1.2.3