diff options
author | Jeremy Harris <jgh146exb@wizmail.org> | 2019-12-07 22:07:02 +0000 |
---|---|---|
committer | Jeremy Harris <jgh146exb@wizmail.org> | 2019-12-07 22:07:02 +0000 |
commit | ab6b4fdbded98ca6d185409e3c419ab1bfb26422 (patch) | |
tree | 5bdf8547fa17971c700b807d11bf9eb2890399d1 /src/OS | |
parent | adf703b6582dcb89a2592b3519fd2e5ed30682f3 (diff) |
FreeBSD: fix sendfile shim
Diffstat (limited to 'src/OS')
-rw-r--r-- | src/OS/Makefile-Base | 28 | ||||
-rw-r--r-- | src/OS/os.c-FreeBSD | 12 |
2 files changed, 11 insertions, 29 deletions
diff --git a/src/OS/Makefile-Base b/src/OS/Makefile-Base index 9ecde1d3e..36af8308d 100644 --- a/src/OS/Makefile-Base +++ b/src/OS/Makefile-Base @@ -79,23 +79,8 @@ Makefile: ../OS/Makefile-Base ../OS/Makefile-Default \ # Build (link) the os.h file -#os.h: $(SCRIPTS)/Configure-os.h \ -# $(O)/os.h-AIX $(O)/os.h-BSDI $(O)/os.h-cygwin \ -# $(O)/os.h-Darwin $(O)/os.h-DGUX $(O)/os.h-DragonFly \ -# $(O)/os.h-FreeBSD $(O)/os.h-GNU $(O)/os.h-GNUkFreeBSD \ -# $(O)/os.h-GNUkNetBSD $(O)/os.h-HI-OSF \ -# $(O)/os.h-HI-UX $(O)/os.h-HP-UX $(O)/os.h-HP-UX-9 \ -# $(O)/os.h-IRIX $(O)/os.h-IRIX6 $(O)/os.h-IRIX632 \ -# $(O)/os.h-IRIX65 $(O)/os.h-Linux $(O)/os.h-mips \ -# $(O)/os.h-NetBSD $(O)/os.h-NetBSD-a.out \ -# $(O)/os.h-OpenBSD $(O)/os.h-OpenUNIX $(O)/os.h-OSF1 \ -# $(O)/os.h-QNX $(O)/os.h-SCO $(O)/os.h-SCO_SV \ -# $(O)/os.h-SunOS4 $(O)/os.h-SunOS5 $(O)/os.h-SunOS5-hal \ -# $(O)/os.h-ULTRIX $(O)/os.h-UNIX_SV \ -# $(O)/os.h-Unixware7 $(O)/os.h-USG -# $(SHELL) $(SCRIPTS)/Configure-os.h - os.h: $(SCRIPTS)/Configure-os.h \ + $(O)/os.h-Darwin \ $(O)/os.h-FreeBSD \ $(O)/os.h-GNU \ $(O)/os.h-Linux \ @@ -105,17 +90,12 @@ os.h: $(SCRIPTS)/Configure-os.h \ # Build the os.c file -#os.c: ../src/os.c \ -# $(SCRIPTS)/Configure-os.c \ -# $(O)/os.c-cygwin $(O)/os.c-GNU $(O)/os.c-HI-OSF \ -# $(O)/os.c-IRIX $(O)/os.c-IRIX6 $(O)/os.c-IRIX632 \ -# $(O)/os.c-IRIX65 $(O)/os.c-Linux $(O)/os.c-OSF1 -# $(SHELL) $(SCRIPTS)/Configure-os.c - os.c: ../src/os.c \ $(SCRIPTS)/Configure-os.c \ + $(O)/os.c-FreeBSD \ $(O)/os.c-GNU \ - $(O)/os.c-Linux + $(O)/os.c-Linux \ + $(O)/os.c-SunOS5 $(SHELL) $(SCRIPTS)/Configure-os.c # Build the config.h file. diff --git a/src/OS/os.c-FreeBSD b/src/OS/os.c-FreeBSD index 1261b8557..4cc46c752 100644 --- a/src/OS/os.c-FreeBSD +++ b/src/OS/os.c-FreeBSD @@ -2,7 +2,7 @@ * Exim - an Internet mail transport agent * *************************************************/ -/* Copyright (c) Jeremy Harris 1995 - 2018 */ +/* Copyright (c) Jeremy Harris 1995 - 2019 */ /* See the file NOTICE for conditions of use and distribution. */ /* FreeBSD-specific code. This is concatenated onto the generic @@ -14,11 +14,13 @@ src/os.c file. */ *************/ ssize_t -os_sendfile(int out, int in, off_t * off, size_t cnt) +os_sendfile(int out, int in, off_t * offp, size_t cnt) { -off_t written; -return sendfile(in, out, *off, cnt, NULL, &written, 0) < 0 - ? (ssize_t) -1 : (ssize_t) written; +off_t loff = *offp, written; + +if (sendfile(in, out, loff, cnt, NULL, &written, 0) < 0) return (ssize_t)-1; +*offp = loff + written; +return (ssize_t)written; } /* End of os.c-Linux */ |