aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.cc
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2024-09-02 12:16:49 +0100
committerJonathan Wakely <redi@gcc.gnu.org>2024-09-03 16:18:21 +0100
commit71b1639c67b91554420cc38eb4c82323e535c816 (patch)
tree591ab161927ae4d10756bafb49114be21656fdfc /gcc/expr.cc
parent819deae0a5bee079a7d5582fafaa098c26144ae8 (diff)
downloadgcc-71b1639c67b91554420cc38eb4c82323e535c816.zip
gcc-71b1639c67b91554420cc38eb4c82323e535c816.tar.gz
gcc-71b1639c67b91554420cc38eb4c82323e535c816.tar.bz2
libstdc++: Fix error handling in fs::hard_link_count for Windows
The recent change to use auto_win_file_handle for std::filesystem::hard_link_count caused a regression. The std::error_code argument should be cleared if no error occurs, but this no longer happens. Add a call to ec.clear() in fs::hard_link_count to fix this. Also change the auto_win_file_handle class to take a reference to the std::error_code and set it if an error occurs, to slightly simplify the control flow in the fs::equiv_files function. libstdc++-v3/ChangeLog: * src/c++17/fs_ops.cc (auto_win_file_handle): Add error_code& member and set it if CreateFileW or GetFileInformationByHandle fails. (fs::equiv_files) [_GLIBCXX_FILESYSTEM_IS_WINDOWS]: Simplify control flow. (fs::hard_link_count) [_GLIBCXX_FILESYSTEM_IS_WINDOWS]: Clear ec on success. * testsuite/27_io/filesystem/operations/hard_link_count.cc: Check error handling.
Diffstat (limited to 'gcc/expr.cc')
0 files changed, 0 insertions, 0 deletions