mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
net/http: fixed TestLinuxSendfile for mips64
mips64 strace doesn't support sendfile64 and will error out if we specify that with `-e trace='. So we use sendfile for mips64 here. Change-Id: If5e2bb39866ca3a77dcc40e4db338ba486921d89 Reviewed-on: https://go-review.googlesource.com/14455 Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
84df38181b
commit
eebf7d279b
1 changed files with 9 additions and 1 deletions
|
|
@ -917,8 +917,16 @@ func TestLinuxSendfile(t *testing.T) {
|
||||||
}
|
}
|
||||||
defer ln.Close()
|
defer ln.Close()
|
||||||
|
|
||||||
|
syscalls := "sendfile,sendfile64"
|
||||||
|
switch runtime.GOARCH {
|
||||||
|
case "mips64", "mips64le":
|
||||||
|
// mips64 strace doesn't support sendfile64 and will error out
|
||||||
|
// if we specify that with `-e trace='.
|
||||||
|
syscalls = "sendfile"
|
||||||
|
}
|
||||||
|
|
||||||
var buf bytes.Buffer
|
var buf bytes.Buffer
|
||||||
child := exec.Command("strace", "-f", "-q", "-e", "trace=sendfile,sendfile64", os.Args[0], "-test.run=TestLinuxSendfileChild")
|
child := exec.Command("strace", "-f", "-q", "-e", "trace="+syscalls, os.Args[0], "-test.run=TestLinuxSendfileChild")
|
||||||
child.ExtraFiles = append(child.ExtraFiles, lnf)
|
child.ExtraFiles = append(child.ExtraFiles, lnf)
|
||||||
child.Env = append([]string{"GO_WANT_HELPER_PROCESS=1"}, os.Environ()...)
|
child.Env = append([]string{"GO_WANT_HELPER_PROCESS=1"}, os.Environ()...)
|
||||||
child.Stdout = &buf
|
child.Stdout = &buf
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue