libstdc++: Use correct error category for Windows error codes
authorJonathan Wakely <jwakely@redhat.com>
Wed, 10 Feb 2021 16:45:38 +0000 (16:45 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Wed, 10 Feb 2021 16:45:38 +0000 (16:45 +0000)
commit313e2dc377d07d5fae5a3fd666ad7000d7e8771d
tree4ebee38d57a7e804ad73dc972482fa88afa1d545
parent6a6f74be9d6891cb0c17c493b1f9bca20673e6a0
libstdc++: Use correct error category for Windows error codes

When the result of GetLastError() is stored in a std::error_code it
should use std::system_category(), not std::generic_category() that is
used for POSIX errno values.

libstdc++-v3/ChangeLog:

* src/c++17/fs_ops.cc (fs::create_hard_link, fs::equivalent)
(fs::remove): Use std::system_category() for error codes from
GetLastError().
* src/filesystem/ops.cc (fs::create_hard_link, fs::remove):
Likewise.
libstdc++-v3/src/c++17/fs_ops.cc
libstdc++-v3/src/filesystem/ops.cc