]> 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:51:28 +0000 (14:51 +0200)
configure
src/muxer.c

index 1bde7244cbe4edb562ba39c27708abb512553f23..d64cd456703ac32a5fddc76d55d2bfb887b38463 100755 (executable)
--- a/configure
+++ b/configure
@@ -166,6 +166,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 6df8b73ce49aa6b9a214f816e75c8f4a990780f6..784b1c67dbeebbfdbfd3e3ea56aa622ff7b888c7 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