libstdc++/70609 fix filesystem::copy()
authorJonathan Wakely <jwakely@redhat.com>
Tue, 19 Apr 2016 18:02:39 +0000 (19:02 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Tue, 19 Apr 2016 18:02:39 +0000 (19:02 +0100)
commit149052510483ab2ea3cf02d085e1f31ebe5360c5
tree969f95aefd9527a1f249ca7155f17f8ec69d9f1c
parent9c476ad42618dd03353d8f8ae82b00a945974ecd
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().

From-SVN: r235215
libstdc++-v3/ChangeLog
libstdc++-v3/src/filesystem/ops.cc
libstdc++-v3/testsuite/experimental/filesystem/operations/copy.cc