From: Jeremy Harris Date: Sun, 10 Oct 2021 10:20:56 +0000 (+0100) Subject: FreeBSD: fix sendfile shim X-Git-Tag: exim-4.96-RC0~159 X-Git-Url: https://git.exim.org/exim.git/commitdiff_plain/0fdd8204644a6ae3daa310b3f5906b5c8b8ea0b4 FreeBSD: fix sendfile shim --- diff --git a/doc/doc-txt/ChangeLog b/doc/doc-txt/ChangeLog index 6d78cd320..4e0d602dd 100644 --- a/doc/doc-txt/ChangeLog +++ b/doc/doc-txt/ChangeLog @@ -18,6 +18,9 @@ JH/03 Constification work in the filters module required a major version global which is visible via the API is now const and may therefore not be modified by local-scan code. +JH/04 Fix ClamAV TCP use under FreeBSD. Previously the OS-specific shim for + sendfile() didi not account for the way the ClamAV driver code called it. + Exim version 4.95 ----------------- 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; }