diff options
author | Eric Fiselier <eric@efcs.ca> | 2018-07-26 04:02:06 +0000 |
---|---|---|
committer | Eric Fiselier <eric@efcs.ca> | 2018-07-26 04:02:06 +0000 |
commit | 5d9694759182cdd966e7bac611da21d0a18c1536 (patch) | |
tree | 595ed2352f62aec827e7cb97850a1ee4ab2de988 /libcxx/src | |
parent | a0a7c1f552ab023bef738529c4d7ce2fc4e7a338 (diff) | |
download | bcm5719-llvm-5d9694759182cdd966e7bac611da21d0a18c1536.tar.gz bcm5719-llvm-5d9694759182cdd966e7bac611da21d0a18c1536.zip |
Be more consistent about which bool value means an error occurred
llvm-svn: 338002
Diffstat (limited to 'libcxx/src')
-rw-r--r-- | libcxx/src/experimental/filesystem/operations.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libcxx/src/experimental/filesystem/operations.cpp b/libcxx/src/experimental/filesystem/operations.cpp index 028d5bf0bbd..775c178b37e 100644 --- a/libcxx/src/experimental/filesystem/operations.cpp +++ b/libcxx/src/experimental/filesystem/operations.cpp @@ -433,19 +433,19 @@ bool posix_ftruncate(const FileDescriptor& fd, size_t to_size, 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 path& to, copy_options options, 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); } |