Archive: Fix temp path names.

llvm-svn: 123660
This commit is contained in:
Michael J. Spencer 2011-01-17 16:43:30 +00:00
parent e65ed1c794
commit 992efd12a7
1 changed files with 6 additions and 4 deletions

View File

@ -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;
}