From: E.Smith <31170571+azlm8t@users.noreply.github.com> Date: Mon, 17 Sep 2018 12:10:27 +0000 (+0100) Subject: FreeBSD: Check for fdatasync system call since it is supported on FreeBSD 11.1 and... X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d7fe431f96a10b837e0b7f7fb9bc653fd14a797f;p=thirdparty%2Ftvheadend.git FreeBSD: Check for fdatasync system call since it is supported on FreeBSD 11.1 and later. --- diff --git a/configure b/configure index b183d02b3..9f34ac36f 100755 --- a/configure +++ b/configure @@ -173,6 +173,12 @@ int test(int argc, char **argv) { return 0; }' +check_cc_snippet fdatasync '#include +int test(int argc, char **argv) { + fdatasync(0); + return 0; +}' + check_cc_snippet getloadavg '#include void test() { getloadavg(NULL,0); }' diff --git a/src/muxer.c b/src/muxer.c index 3e1987597..1da9dead8 100644 --- a/src/muxer.c +++ b/src/muxer.c @@ -29,11 +29,14 @@ #include "muxer/muxer_libav.h" #endif +/* Newer platforms such as FreeBSD 11.1 support fdatasync so only alias on older systems */ +#ifndef CONFIG_FDATASYNC #if defined(PLATFORM_DARWIN) #define fdatasync(fd) fcntl(fd, F_FULLFSYNC) #elif defined(PLATFORM_FREEBSD) #define fdatasync(fd) fsync(fd) #endif +#endif /** * Mime type for containers containing only audio