summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Archive
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2011-01-17 16:43:30 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2011-01-17 16:43:30 +0000
commit992efd12a7eaf85d2373c8ac9dd52fe0ee3aae89 (patch)
tree4fbc2d6a39933ef16d1069e7e0dec84a9df58f33 /llvm/lib/Archive
parente65ed1c79492ff3cebf77b634544dbef954e8ab9 (diff)
downloadbcm5719-llvm-992efd12a7eaf85d2373c8ac9dd52fe0ee3aae89.tar.gz
bcm5719-llvm-992efd12a7eaf85d2373c8ac9dd52fe0ee3aae89.zip
Archive: Fix temp path names.
llvm-svn: 123660
Diffstat (limited to 'llvm/lib/Archive')
-rw-r--r--llvm/lib/Archive/ArchiveWriter.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/lib/Archive/ArchiveWriter.cpp b/llvm/lib/Archive/ArchiveWriter.cpp
index 59fb7bdd3ff..c5ad5fc41cd 100644
--- a/llvm/lib/Archive/ArchiveWriter.cpp
+++ b/llvm/lib/Archive/ArchiveWriter.cpp
@@ -364,8 +364,9 @@ Archive::writeToDisk(bool CreateSymbolTable, bool TruncateNames, bool Compress,
// Create a temporary file to store the archive in
SmallString<128> TempArchivePath;
int ArchFD;
- if (error_code ec = sys::fs::unique_file("%%-%%-%%-%%" + archPath.str(),
- ArchFD, TempArchivePath)) {
+ if (error_code ec =
+ sys::fs::unique_file("%%-%%-%%-%%-" + sys::path::filename(archPath.str()),
+ ArchFD, TempArchivePath)) {
if (ErrMsg) *ErrMsg = ec.message();
return true;
}
@@ -421,8 +422,9 @@ Archive::writeToDisk(bool CreateSymbolTable, bool TruncateNames, bool Compress,
// Open another temporary file in order to avoid invalidating the
// mmapped data
- if (error_code ec = sys::fs::unique_file("%%-%%-%%-%%" + archPath.str(),
- ArchFD, TempArchiveWithSymbolTablePath)) {
+ if (error_code ec =
+ sys::fs::unique_file("%%-%%-%%-%%-" + sys::path::filename(archPath.str()),
+ ArchFD, TempArchiveWithSymbolTablePath)) {
if (ErrMsg) *ErrMsg = ec.message();
return true;
}
OpenPOWER on IntegriCloud