summaryrefslogtreecommitdiffstats
path: root/llvm
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
commitc9b82d76e27e4b76dc703670c167c4e5f3071250 (patch)
tree5a2e5949dc1824045cfe60c68b4226960f640dc8 /llvm
parent12493bb7d584afa01a64659d300b10c4dfdb0755 (diff)
downloadbcm5719-llvm-c9b82d76e27e4b76dc703670c167c4e5f3071250.tar.gz
bcm5719-llvm-c9b82d76e27e4b76dc703670c167c4e5f3071250.zip
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. llvm-svn: 185825
Diffstat (limited to 'llvm')
-rw-r--r--llvm/tools/llvm-ar/ArchiveWriter.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/tools/llvm-ar/ArchiveWriter.cpp b/llvm/tools/llvm-ar/ArchiveWriter.cpp
index 52ce045c16c..ef910019df4 100644
--- a/llvm/tools/llvm-ar/ArchiveWriter.cpp
+++ b/llvm/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;
OpenPOWER on IntegriCloud