libstdc++/70609 fix filesystem::copy()
commit00d7e7b3273148c277b44d6eec22cfd6f3900639
authorredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 19 Apr 2016 18:02:39 +0000 (19 18:02 +0000)
committerredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 19 Apr 2016 18:02:39 +0000 (19 18:02 +0000)
tree969f95aefd9527a1f249ca7155f17f8ec69d9f1c
parent12133d9121316c5f197398700ec3826d0867954a
libstdc++/70609 fix filesystem::copy()

PR libstdc++/70609
* src/filesystem/ops.cc (close_fd): New function.
(do_copy_file): Set permissions before copying file contents. Check
result of closing file descriptors. Don't copy streambuf when file
is empty.
(copy(const path&, const path&, copy_options, error_code&)): Use
lstat for source file when copy_symlinks is set.
* testsuite/experimental/filesystem/operations/copy.cc: Test copy().

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@235215 138bc75d-0d04-0410-961f-82ee72b054a4
libstdc++-v3/ChangeLog
libstdc++-v3/src/filesystem/ops.cc
libstdc++-v3/testsuite/experimental/filesystem/operations/copy.cc