diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-07-08 16:42:01 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-07-08 16:42:01 +0000 |
commit | 1cce797d32aa465c054fc4a313d8c330c89bd862 (patch) | |
tree | fd5deb37366d1dbb249abe24d6bcfdcb3f777853 /lib/Support/Windows/Path.inc | |
parent | a2030eedf1094ef8508ca90341c5a7ec8f638308 (diff) | |
download | external_llvm-1cce797d32aa465c054fc4a313d8c330c89bd862.zip external_llvm-1cce797d32aa465c054fc4a313d8c330c89bd862.tar.gz external_llvm-1cce797d32aa465c054fc4a313d8c330c89bd862.tar.bz2 |
We now always create files with the correct permissions. Simplify the interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185834 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/Windows/Path.inc')
-rw-r--r-- | lib/Support/Windows/Path.inc | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/lib/Support/Windows/Path.inc b/lib/Support/Windows/Path.inc index ab59fe8..7359994 100644 --- a/lib/Support/Windows/Path.inc +++ b/lib/Support/Windows/Path.inc @@ -692,40 +692,6 @@ handle_status_error: return error_code::success(); } - -// Modifies permissions on a file. -error_code permissions(const Twine &path, perms prms) { -#if 0 // verify code below before enabling: - // If the permissions bits are not trying to modify - // "write" permissions, there is nothing to do. - if (!(prms & (owner_write|group_write|others_write))) - return error_code::success(); - - SmallString<128> path_storage; - SmallVector<wchar_t, 128> path_utf16; - - if (error_code ec = UTF8ToUTF16(path.toStringRef(path_storage), - path_utf16)) - return ec; - - DWORD attributes = ::GetFileAttributesW(path_utf16.begin()); - - if (prms & add_perms) { - attributes &= ~FILE_ATTRIBUTE_READONLY; - } - else if (prms & remove_perms) { - attributes |= FILE_ATTRIBUTE_READONLY; - } - else { - assert(0 && "neither add_perms or remove_perms is set"); - } - - if ( ! ::SetFileAttributesW(path_utf16.begin(), attributes)) - return windows_error(::GetLastError()); -#endif - return error_code::success(); -} - error_code setLastModificationAndAccessTime(int FD, TimeValue Time) { ULARGE_INTEGER UI; UI.QuadPart = Time.toWin32Time(); |