diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2004-12-13 20:08:14 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2004-12-13 20:08:14 +0000 |
commit | 6b8632850ba6ea7196cd39852f047bbe50ab5b83 (patch) | |
tree | 7bfd44700894094de634ffa459202f7df3422cf5 /llvm/lib/Support/FileUtilities.cpp | |
parent | 249eb144d9960d60fd7f81080ce2be93b124f9b0 (diff) | |
download | bcm5719-llvm-6b8632850ba6ea7196cd39852f047bbe50ab5b83.tar.gz bcm5719-llvm-6b8632850ba6ea7196cd39852f047bbe50ab5b83.zip |
For PR351:
Remove the MakeFileReadable and MakeFileExecutable functions which are no
longer present in LLVM. They have been replaced with the sys::Path methods
makeReadable and makeExecutable, respectively.
llvm-svn: 18910
Diffstat (limited to 'llvm/lib/Support/FileUtilities.cpp')
-rw-r--r-- | llvm/lib/Support/FileUtilities.cpp | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/llvm/lib/Support/FileUtilities.cpp b/llvm/lib/Support/FileUtilities.cpp index ee83bc1a56a..6cec414ee1a 100644 --- a/llvm/lib/Support/FileUtilities.cpp +++ b/llvm/lib/Support/FileUtilities.cpp @@ -157,45 +157,6 @@ std::string llvm::getUniqueFilename(const std::string &FilenameBase) { return Result; } -static bool AddPermissionsBits (const std::string &Filename, int bits) { - // Get the umask value from the operating system. We want to use it - // when changing the file's permissions. Since calling umask() sets - // the umask and returns its old value, we must call it a second - // time to reset it to the user's preference. - int mask = umask(0777); // The arg. to umask is arbitrary. - umask(mask); // Restore the umask. - - // Get the file's current mode. - struct stat st; - if ((stat(Filename.c_str(), &st)) == -1) - return false; - - // Change the file to have whichever permissions bits from 'bits' - // that the umask would not disable. - if ((chmod(Filename.c_str(), (st.st_mode | (bits & ~mask)))) == -1) - return false; - - return true; -} - -/// MakeFileExecutable - Make the file named Filename executable by -/// setting whichever execute permissions bits the process's current -/// umask would allow. Filename must name an existing file or -/// directory. Returns true on success, false on error. -/// -bool llvm::MakeFileExecutable(const std::string &Filename) { - return AddPermissionsBits(Filename, 0111); -} - -/// MakeFileReadable - Make the file named Filename readable by -/// setting whichever read permissions bits the process's current -/// umask would allow. Filename must name an existing file or -/// directory. Returns true on success, false on error. -/// -bool llvm::MakeFileReadable(const std::string &Filename) { - return AddPermissionsBits(Filename, 0444); -} - //===----------------------------------------------------------------------===// // FDHandle class implementation // |