Author: ericwf Date: Wed Jul 25 21:02:06 2018 New Revision: 338002 URL: http://llvm.org/viewvc/llvm-project?rev=338002&view=rev Log: Be more consistent about which bool value means an error occurred
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=338002&r1=338001&r2=338002&view=diff ============================================================================== --- libcxx/trunk/src/experimental/filesystem/operations.cpp (original) +++ libcxx/trunk/src/experimental/filesystem/operations.cpp Wed Jul 25 21:02:06 2018 @@ -433,19 +433,19 @@ bool posix_ftruncate(const FileDescripto error_code& ec) { if (::ftruncate(fd.fd, to_size) == -1) { ec = capture_errno(); - return false; + return true; } ec.clear(); - return true; + return false; } bool posix_fchmod(const FileDescriptor& fd, const StatT& st, error_code& ec) { if (::fchmod(fd.fd, st.st_mode) == -1) { ec = capture_errno(); - return false; + return true; } ec.clear(); - return true; + return false; } bool stat_equivalent(const StatT& st1, const StatT& st2) { @@ -796,9 +796,9 @@ bool __copy_file(const path& from, const return err.report(errc::bad_file_descriptor); // Set the permissions and truncate the file we opened. - if (!detail::posix_fchmod(to_fd, from_stat, m_ec)) + if (detail::posix_fchmod(to_fd, from_stat, m_ec)) return err.report(m_ec); - if (!detail::posix_ftruncate(to_fd, 0, m_ec)) + if (detail::posix_ftruncate(to_fd, 0, m_ec)) return err.report(m_ec); } _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits