PR libstdc++/89562
* src/filesystem/ops-common.h (do_copy_file): Open files in binary
mode for mingw.
From-SVN: r269356
+2019-03-03 Jonathan Wakely <jwakely@redhat.com>
+
+ PR libstdc++/89562
+ * src/filesystem/ops-common.h (do_copy_file): Open files in binary
+ mode for mingw.
+
2019-03-01 Jonathan Wakely <jwakely@redhat.com>
* testsuite/util/testsuite_allocator.h (__gnu_test::memory_resource)
int fd;
};
- CloseFD in = { posix::open(from, O_RDONLY) };
+ int iflag = O_RDONLY;
+#ifdef _GLIBCXX_FILESYSTEM_IS_WINDOWS
+ iflag |= O_BINARY;
+#endif
+
+ CloseFD in = { posix::open(from, iflag) };
if (in.fd == -1)
{
ec.assign(errno, std::generic_category());
oflag |= O_TRUNC;
else
oflag |= O_EXCL;
+#ifdef _GLIBCXX_FILESYSTEM_IS_WINDOWS
+ oflag |= O_BINARY;
+#endif
CloseFD out = { posix::open(to, oflag, S_IWUSR) };
if (out.fd == -1)
{