Patchwork libgo patch committed: Fix splice syscall

login
register
mail settings
Submitter Ian Taylor
Date Dec. 5, 2012, 8:49 a.m.
Message ID <mcr1uf4sx34.fsf@google.com>
Download mbox | patch
Permalink /patch/203802/
State New
Headers show

Comments

Ian Taylor - Dec. 5, 2012, 8:49 a.m.
There was a bug in syscall.Splice: it ignored the offsets that were
passed in.  This patch fixes it.  Bootstrapped and ran Go testsuite on
x86_64-unknown-linux-gnu.  Committed to mainline and 4.7 branch.

Ian

Patch

diff -r 36bbf2143cba libgo/go/syscall/libcall_linux.go
--- a/libgo/go/syscall/libcall_linux.go	Tue Dec 04 17:08:39 2012 -0800
+++ b/libgo/go/syscall/libcall_linux.go	Wed Dec 05 00:40:42 2012 -0800
@@ -313,11 +313,13 @@ 
 	var lroff _loff_t
 	var plroff *_loff_t
 	if roff != nil {
+		lroff = _loff_t(*roff)
 		plroff = &lroff
 	}
 	var lwoff _loff_t
 	var plwoff *_loff_t
 	if woff != nil {
+		lwoff = _loff_t(*woff)
 		plwoff = &lwoff
 	}
 	n, err = splice(rfd, plroff, wfd, plwoff, len, flags)