summaryrefslogtreecommitdiff
path: root/tools/llvm-ar
diff options
context:
space:
mode:
authorManuel Klimek <klimek@google.com>2013-07-08 14:44:57 +0000
committerManuel Klimek <klimek@google.com>2013-07-08 14:44:57 +0000
commita012a666888ddd92858eda808af480a01f34bd1e (patch)
treed7342c9e1500ac3c7558a0d880eb1ccd9d4a6b7e /tools/llvm-ar
parent6c75160b875799a9303879e11022edf4ba44c3f9 (diff)
downloadllvm-a012a666888ddd92858eda808af480a01f34bd1e.tar.gz
llvm-a012a666888ddd92858eda808af480a01f34bd1e.tar.bz2
llvm-a012a666888ddd92858eda808af480a01f34bd1e.tar.xz
Fixes problem when calling llvm-ar from an unmodifiable directory.
This fixes a regression introduced by r185726: the new call to get a unique file does not prepend the system temporary directory, so we need to anchor on the file that the temporary file gets moved to to ensure we're on the same file system. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185825 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-ar')
-rw-r--r--tools/llvm-ar/ArchiveWriter.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/llvm-ar/ArchiveWriter.cpp b/tools/llvm-ar/ArchiveWriter.cpp
index 52ce045c16..ef910019df 100644
--- a/tools/llvm-ar/ArchiveWriter.cpp
+++ b/tools/llvm-ar/ArchiveWriter.cpp
@@ -260,8 +260,8 @@ bool Archive::writeToDisk(bool TruncateNames, std::string *ErrMsg) {
// Create a temporary file to store the archive in
int TmpArchiveFD;
SmallString<128> TmpArchive;
- error_code EC = sys::fs::createUniqueFile("temp-archive-%%%%%%%.a",
- TmpArchiveFD, TmpArchive);
+ error_code EC = sys::fs::createUniqueFile(
+ archPath + ".temp-archive-%%%%%%%.a", TmpArchiveFD, TmpArchive);
if (EC)
return true;