diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2016-05-10 15:39:14 +0000 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2016-05-10 15:39:14 +0000 |
commit | ad57cc590cbb4658e18f618726c7a48827951ec1 (patch) | |
tree | 52d984eb545590c03be855afdd8a9ca3f070dbd6 /libstdc++-v3/src | |
parent | ee15bb880ac9211800b67b3850d0c2ced7a60171 (diff) |
libstdc++/71038 fix error checks in filesystem::copy_file
PR libstdc++/71038
* src/filesystem/ops.cc (do_copy_file): Fix backwards conditions.
* testsuite/experimental/filesystem/operations/copy_file.cc: New test.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@236084 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/src')
-rw-r--r-- | libstdc++-v3/src/filesystem/ops.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libstdc++-v3/src/filesystem/ops.cc b/libstdc++-v3/src/filesystem/ops.cc index fab42355f9f..5b82088891e 100644 --- a/libstdc++-v3/src/filesystem/ops.cc +++ b/libstdc++-v3/src/filesystem/ops.cc @@ -450,7 +450,7 @@ namespace ec = std::make_error_code(std::errc::io_error); return false; } - if (sbout.close() || sbin.close()) + if (!sbout.close() || !sbin.close()) { ec.assign(errno, std::generic_category()); return false; |