diff options
author | uros <uros@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-10-27 18:55:55 +0000 |
---|---|---|
committer | uros <uros@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-10-27 18:55:55 +0000 |
commit | 1e312c9c2e8435a76f60a3837eb5cd8180ecda5c (patch) | |
tree | 4ea39a1246fa9188aec95ff3d20641e31b04f656 /libstdc++-v3/src/filesystem/ops.cc | |
parent | b95a2fd4a74c9ec1f9913e958b5291b30d53f60f (diff) |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@241629 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/src/filesystem/ops.cc')
-rw-r--r-- | libstdc++-v3/src/filesystem/ops.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libstdc++-v3/src/filesystem/ops.cc b/libstdc++-v3/src/filesystem/ops.cc index 9abcee0ea9b7..8ed0a105dfa3 100644 --- a/libstdc++-v3/src/filesystem/ops.cc +++ b/libstdc++-v3/src/filesystem/ops.cc @@ -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 |