summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJeremy Harris <jgh146exb@wizmail.org>2021-10-10 11:20:56 +0100
committerJeremy Harris <jgh146exb@wizmail.org>2021-10-10 11:20:56 +0100
commit0fdd8204644a6ae3daa310b3f5906b5c8b8ea0b4 (patch)
tree8a8872843875552cb1f43b9c98901768d87ad6ad /src
parent7dd249088ba72730d8c05a38e02a56f82ff3fe92 (diff)
FreeBSD: fix sendfile shim
Diffstat (limited to 'src')
-rw-r--r--src/OS/os.c-FreeBSD2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/OS/os.c-FreeBSD b/src/OS/os.c-FreeBSD
index cb0b0bf7f..38df91cf4 100644
--- a/src/OS/os.c-FreeBSD
+++ b/src/OS/os.c-FreeBSD
@@ -19,7 +19,7 @@ os_sendfile(int out, int in, off_t * offp, size_t cnt)
off_t loff = *offp, written;
if (sendfile(in, out, loff, cnt, NULL, &written, 0) < 0) return (ssize_t)-1;
-*offp = loff + written;
+if (offp) *offp = loff + written;
return (ssize_t)written;
}