Author: ericwf Date: Wed Jun 22 02:24:00 2016 New Revision: 273391 URL: http://llvm.org/viewvc/llvm-project?rev=273391&view=rev Log: Avoid unnecessary stat call in filesystem::permissions implementation.
Modified: libcxx/trunk/src/experimental/filesystem/operations.cpp Modified: libcxx/trunk/src/experimental/filesystem/operations.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/src/experimental/filesystem/operations.cpp?rev=273391&r1=273390&r2=273391&view=diff ============================================================================== --- libcxx/trunk/src/experimental/filesystem/operations.cpp (original) +++ libcxx/trunk/src/experimental/filesystem/operations.cpp Wed Jun 22 02:24:00 2016 @@ -602,7 +602,8 @@ void __permissions(const path& p, perms "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 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits