From: Karel Zak Date: Mon, 9 Nov 2020 14:30:06 +0000 (+0100) Subject: build-sys: fix sendfile use X-Git-Tag: v2.37-rc1~390 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=782cc33a02b0b9440017997e9321fcf7d54eaf64;p=thirdparty%2Futil-linux.git build-sys: fix sendfile use * OSX uses different prototype * include file is not covered by HAVE_SYS_SENDIFLE_H Signed-off-by: Karel Zak --- diff --git a/configure.ac b/configure.ac index 9896dfaf24..a9b13c3dba 100644 --- a/configure.ac +++ b/configure.ac @@ -319,6 +319,7 @@ AC_CHECK_HEADERS([ \ sys/socket.h \ sys/sockio.h \ sys/stat.h \ + sys/sendfile.h \ sys/sysmacros.h \ sys/swap.h \ sys/syscall.h \ diff --git a/include/all-io.h b/include/all-io.h index 2c367a42d8..5ed2d11a2e 100644 --- a/include/all-io.h +++ b/include/all-io.h @@ -13,8 +13,8 @@ #include #include #include -#ifdef HAVE_SENDFILE -#include +#ifdef HAVE_SYS_SENDFILE_H +# include #endif #include "c.h" @@ -86,7 +86,7 @@ static inline ssize_t read_all(int fd, char *buf, size_t count) static inline ssize_t sendfile_all(int out, int in, off_t *off, size_t count) { -#ifdef HAVE_SENDFILE +#if defined(HAVE_SENDFILE) && defined(__linux__) ssize_t ret; ssize_t c = 0; int tries = 0;