aboutsummaryrefslogtreecommitdiff
path: root/src/internal/poll/sendfile_bsd.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/internal/poll/sendfile_bsd.go')
-rw-r--r--src/internal/poll/sendfile_bsd.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/internal/poll/sendfile_bsd.go b/src/internal/poll/sendfile_bsd.go
index a24e41dcaa..66005a9f5c 100644
--- a/src/internal/poll/sendfile_bsd.go
+++ b/src/internal/poll/sendfile_bsd.go
@@ -18,6 +18,10 @@ func SendFile(dstFD *FD, src int, pos, remain int64) (int64, error) {
return 0, err
}
defer dstFD.writeUnlock()
+ if err := dstFD.pd.prepareWrite(dstFD.isFile); err != nil {
+ return 0, err
+ }
+
dst := int(dstFD.Sysfd)
var written int64
var err error