Avoid unnecessary stat call in filesystem::permissions implementation.

llvm-svn: 273391
This commit is contained in:
Eric Fiselier 2016-06-22 07:24:00 +00:00
parent eea7a01a28
commit c4f6eda006
1 changed files with 2 additions and 1 deletions

View File

@ -602,7 +602,8 @@ void __permissions(const path& p, perms prms, std::error_code *ec)
"Both add_perms and remove_perms are set");
std::error_code m_ec;
file_status st = detail::posix_lstat(p, &m_ec);
file_status st = resolve_symlinks ? detail::posix_stat(p, &m_ec)
: detail::posix_lstat(p, &m_ec);
if (m_ec) return set_or_throw(m_ec, ec, "permissions", p);
// AT_SYMLINK_NOFOLLOW can only be used on symlinks, using it on a regular