]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
FreeBSD: Check for fdatasync system call since it is supported on FreeBSD 11.1 and...
authorE.Smith <31170571+azlm8t@users.noreply.github.com>
Mon, 17 Sep 2018 12:10:27 +0000 (13:10 +0100)
committerJaroslav Kysela <perex@perex.cz>
Thu, 20 Sep 2018 12:38:27 +0000 (14:38 +0200)
configure
src/muxer.c

index b183d02b328367e2e5bd205bcd4673d87ae54d7a..9f34ac36f321a4a13f88fea6f619fdf0f17e15e5 100755 (executable)
--- a/configure
+++ b/configure
@@ -173,6 +173,12 @@ int test(int argc, char **argv) {
   return 0;
 }'
 
+check_cc_snippet fdatasync '#include <unistd.h>
+int test(int argc, char **argv) {
+  fdatasync(0);
+  return 0;
+}'
+
 check_cc_snippet getloadavg '#include <stdlib.h>
 void test() { getloadavg(NULL,0); }'
 
index 3e19875970f7503609c07021bc0b71cae4d2dd70..1da9dead894cae4552f9d53d9c64f3f53168336c 100644 (file)
 #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