Commit 47ffb5d9 by Uros Bizjak Committed by Uros Bizjak

PR70975 Pass valid offset argument to sendfile

	PR libstdc++/70975
	* src/filesystem/ops.cc (do_copy_file) [_GLIBCXX_USE_SENDFILE]:
	Pass non-null pointer to sendfile for offset argument.

From-SVN: r241629
parent 4ce71579
2016-10-27 Uros Bizjak <ubizjak@gmail.com>
PR libstdc++/70975
* src/filesystem/ops.cc (do_copy_file) [_GLIBCXX_USE_SENDFILE]:
Pass non-null pointer to sendfile for offset argument.
2016-10-27 Jonathan Wakely <jwakely@redhat.com>
* testsuite/ext/random/uniform_inside_sphere_distribution/cons/
......
......@@ -444,7 +444,8 @@ namespace
}
#ifdef _GLIBCXX_USE_SENDFILE
const auto n = ::sendfile(out.fd, in.fd, nullptr, from_st->st_size);
off_t offset = 0;
const auto n = ::sendfile(out.fd, in.fd, &offset, from_st->st_size);
if (n < 0 && (errno == ENOSYS || errno == EINVAL))
{
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment