summaryrefslogtreecommitdiff
path: root/libgo/go/net/sendfile_linux.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/net/sendfile_linux.go')
-rw-r--r--libgo/go/net/sendfile_linux.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/libgo/go/net/sendfile_linux.go b/libgo/go/net/sendfile_linux.go
index 5e117636a80..5ca41c39eb5 100644
--- a/libgo/go/net/sendfile_linux.go
+++ b/libgo/go/net/sendfile_linux.go
@@ -64,13 +64,16 @@ func sendFile(c *netFD, r io.Reader) (written int64, err error, handled bool) {
if err1 != nil {
// This includes syscall.ENOSYS (no kernel
// support) and syscall.EINVAL (fd types which
- // don't implement sendfile together)
- err = &OpError{"sendfile", c.net, c.raddr, err1}
+ // don't implement sendfile)
+ err = err1
break
}
}
if lr != nil {
lr.N = remain
}
+ if err != nil {
+ err = os.NewSyscallError("sendfile", err)
+ }
return written, err, written > 0
}