diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-06-22 02:34:24 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-06-22 02:34:24 +0000 |
commit | 19ead5a9f1c758641fb148f9c5fb64e381f90ad3 (patch) | |
tree | eec45a402e739431d9682ee5a4c7e56f019fd63f /tools/llvm-ar/ArchiveWriter.cpp | |
parent | 068463b714bd53fffd41322a5654b4f359c2166c (diff) | |
download | llvm-19ead5a9f1c758641fb148f9c5fb64e381f90ad3.tar.gz llvm-19ead5a9f1c758641fb148f9c5fb64e381f90ad3.tar.bz2 llvm-19ead5a9f1c758641fb148f9c5fb64e381f90ad3.tar.xz |
Create the file with the right permissions instead of setting it afterwards.
Removes the last use of PathV1.h in llvm-ar.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184630 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-ar/ArchiveWriter.cpp')
-rw-r--r-- | tools/llvm-ar/ArchiveWriter.cpp | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/tools/llvm-ar/ArchiveWriter.cpp b/tools/llvm-ar/ArchiveWriter.cpp index 2e4c2e178c..8f010ad7ba 100644 --- a/tools/llvm-ar/ArchiveWriter.cpp +++ b/tools/llvm-ar/ArchiveWriter.cpp @@ -18,7 +18,6 @@ #include "llvm/IR/Module.h" #include "llvm/Support/FileSystem.h" #include "llvm/Support/MemoryBuffer.h" -#include "llvm/Support/PathV1.h" #include "llvm/Support/Process.h" #include "llvm/Support/Signals.h" #include "llvm/Support/system_error.h" @@ -269,7 +268,7 @@ bool Archive::writeToDisk(bool TruncateNames, std::string *ErrMsg) { int TmpArchiveFD; SmallString<128> TmpArchive; error_code EC = sys::fs::unique_file("temp-archive-%%%%%%%.a", TmpArchiveFD, - TmpArchive); + TmpArchive, true, 0666); if (EC) return true; @@ -305,12 +304,5 @@ bool Archive::writeToDisk(bool TruncateNames, std::string *ErrMsg) { return true; } - // Set correct read and write permissions after temporary file is moved - // to final destination path. - if (sys::Path(archPath).makeReadableOnDisk(ErrMsg)) - return true; - if (sys::Path(archPath).makeWriteableOnDisk(ErrMsg)) - return true; - return false; } |