aboutsummaryrefslogtreecommitdiff
path: root/libobjc/error.c
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-04 21:34:36 +0100
commita054ba563bde3dc834c5efac72b91c2803e4e289 (patch)
tree2b225def1d60dd21d24165e8e569945bc75c78cb /libobjc/error.c
parent35c98149a5c7af9159fa7615d8d827b3aaa3cc97 (diff)
downloadgcc-releases/gcc-14.zip
gcc-releases/gcc-14.tar.gz
gcc-releases/gcc-14.tar.bz2
libstdc++: Fix error handling in fs::hard_link_count for Windowsreleases/gcc-14
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. (cherry picked from commit 71b1639c67b91554420cc38eb4c82323e535c816)
Diffstat (limited to 'libobjc/error.c')
0 files changed, 0 insertions, 0 deletions