Don't ask for a mode when we are not keeping the file.
authorRafael Espindola <rafael.espindola@gmail.com>
Fri, 28 Jun 2013 01:05:47 +0000 (01:05 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Fri, 28 Jun 2013 01:05:47 +0000 (01:05 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185123 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Support/FileSystem.h
lib/Support/Path.cpp

index c29d142ab118f293c36fba7f4ab0fa57e9ea88ef..3244517644e732fe71c682c3ac51a92a0800253f 100644 (file)
@@ -573,8 +573,7 @@ error_code unique_file(const Twine &model, int &result_fd,
 
 /// @brief Simpler version for clients that don't want an open file.
 error_code unique_file(const Twine &Model, SmallVectorImpl<char> &ResultPath,
-                       bool MakeAbsolute = true,
-                       unsigned Mode = owner_read | owner_write);
+                       bool MakeAbsolute = true);
 
 error_code createUniqueDirectory(const Twine &Prefix,
                                  SmallVectorImpl<char> &ResultPath);
index a631c760fd7c96dead52a5e55f14b5376bf6401c..1f4f44acb080bef8e95a0a30d953d18035e8cfb4 100644 (file)
@@ -626,12 +626,12 @@ bool is_relative(const Twine &path) {
 namespace fs {
 
 error_code unique_file(const Twine &Model, SmallVectorImpl<char> &ResultPath,
-                       bool MakeAbsolute, unsigned Mode) {
+                       bool MakeAbsolute) {
   // FIXME: This is really inefficient. unique_path creates a path an tries to
   // open it. We should factor the code so that we just don't create/open the
   // file when we don't need it.
   int FD;
-  error_code Ret = unique_file(Model, FD, ResultPath, MakeAbsolute, Mode);
+  error_code Ret = unique_file(Model, FD, ResultPath, MakeAbsolute, all_read);
   if (Ret)
     return Ret;