From a974d523f9ed7c4bd73f1e683eeab25e4430f5ac Mon Sep 17 00:00:00 2001 From: ian Date: Sat, 21 Nov 2015 04:43:50 +0000 Subject: [PATCH] PR go/66378 syscall: Fix initial offset value in syscall.Sendfile. Bug reported in https://gcc.gnu.org/PR66378. Reviewed-on: https://go-review.googlesource.com/17159 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230699 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/go/gofrontend/MERGE | 2 +- libgo/go/syscall/libcall_bsd.go | 1 + libgo/go/syscall/libcall_linux.go | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index d03d18eb37cb..9ee3535a4f7b 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -81dcb1ba4de82a6c9325cb322d5a832a6b1f168d +97ec885c715b3922b0866c081554899b8d50933a The first line of this file holds the git revision number of the last merge done from the gofrontend repository. diff --git a/libgo/go/syscall/libcall_bsd.go b/libgo/go/syscall/libcall_bsd.go index 4501f88ad481..f77260854c73 100644 --- a/libgo/go/syscall/libcall_bsd.go +++ b/libgo/go/syscall/libcall_bsd.go @@ -17,6 +17,7 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e var soff Offset_t var psoff *Offset_t if offset != nil { + soff = Offset_t(*offset) psoff = &soff } written, err = sendfile(outfd, infd, psoff, count) diff --git a/libgo/go/syscall/libcall_linux.go b/libgo/go/syscall/libcall_linux.go index 50b04ff5af94..f0479eb02eee 100644 --- a/libgo/go/syscall/libcall_linux.go +++ b/libgo/go/syscall/libcall_linux.go @@ -327,6 +327,7 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e var soff Offset_t var psoff *Offset_t if offset != nil { + soff = Offset_t(*offset) psoff = &soff } written, err = sendfile(outfd, infd, psoff, count) -- 2.47.2