PR 66378 points out that syscall.Sendfile does not correct handle an
offset argument: it ignored the initial value.  This patch fixes the
problem.  Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu.
Committed to mainline and GCC 5 branch.

Ian
Index: gcc/go/gofrontend/MERGE
===================================================================
--- gcc/go/gofrontend/MERGE     (revision 230695)
+++ gcc/go/gofrontend/MERGE     (working copy)
@@ -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.
Index: libgo/go/syscall/libcall_bsd.go
===================================================================
--- libgo/go/syscall/libcall_bsd.go     (revision 230463)
+++ libgo/go/syscall/libcall_bsd.go     (working copy)
@@ -17,6 +17,7 @@ func Sendfile(outfd int, infd int, offse
        var soff Offset_t
        var psoff *Offset_t
        if offset != nil {
+               soff = Offset_t(*offset)
                psoff = &soff
        }
        written, err = sendfile(outfd, infd, psoff, count)
Index: libgo/go/syscall/libcall_linux.go
===================================================================
--- libgo/go/syscall/libcall_linux.go   (revision 230463)
+++ libgo/go/syscall/libcall_linux.go   (working copy)
@@ -327,6 +327,7 @@ func Sendfile(outfd int, infd int, offse
        var soff Offset_t
        var psoff *Offset_t
        if offset != nil {
+               soff = Offset_t(*offset)
                psoff = &soff
        }
        written, err = sendfile(outfd, infd, psoff, count)

Reply via email to