From: ian Date: Tue, 2 Oct 2018 15:07:14 +0000 (+0000) Subject: net: don't fail test if splice fails because pipe2 is missing X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4580c5a5a1b2aa17942d4d7ccede83d7b9f81f38;p=thirdparty%2Fgcc.git net: don't fail test if splice fails because pipe2 is missing This reportedly happens on CentOS 5.11. The real code will work fine; this test is assuming that the unexported slice function will handle the splice, but if pipe2 does not work then it doesn't. The relevant code in internal/poll/splice_linux.go says "Falling back to pipe is possible, but prior to 2.6.29 splice returns -EAGAIN instead of 0 when the connection is closed." Reviewed-on: https://go-review.googlesource.com/138838 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@264793 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index ad3253f4b85b..b9528721ad3a 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -53d0d7ca278a5612fcdb5fb098e7bf950a0178ef +098e36f4ddfcf50aeb34509b5f25b86d7050749c 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/net/splice_test.go b/libgo/go/net/splice_test.go index 44a5c00ba872..40ed19b8fa8f 100644 --- a/libgo/go/net/splice_test.go +++ b/libgo/go/net/splice_test.go @@ -11,7 +11,9 @@ import ( "fmt" "io" "io/ioutil" + "os" "sync" + "syscall" "testing" ) @@ -225,6 +227,10 @@ func testSpliceReaderAtEOF(t *testing.T) { serverUp.Close() _, err, handled := splice(serverDown.(*TCPConn).fd, serverUp) if !handled { + if serr, ok := err.(*os.SyscallError); ok && serr.Syscall == "pipe2" && serr.Err == syscall.ENOSYS { + t.Skip("pipe2 not supported") + } + t.Errorf("closed connection: got err = %v, handled = %t, want handled = true", err, handled) } lr := &io.LimitedReader{