]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
utils: FreeBSD supports fdatasync(2)
authorCy Schubert <Cy.Schubert@cschubert.com>
Tue, 8 Jun 2021 03:33:20 +0000 (20:33 -0700)
committerJouni Malinen <j@w1.fi>
Wed, 25 Aug 2021 13:20:17 +0000 (16:20 +0300)
FreeBSD supports fdatasync(2). Enable it in os_unix.c.

Signed-off-by: Cy Schubert <cy@FreeBSD.org>
src/utils/os_unix.c

index 1de37204d710678c69c83cf5074834bf62a4ad78..258deef9dd55bda718363212e38b5f4002cf14b2 100644 (file)
@@ -464,9 +464,9 @@ int os_file_exists(const char *fname)
 int os_fdatasync(FILE *stream)
 {
        if (!fflush(stream)) {
-#ifdef __linux__
+#if defined __FreeBSD__ || defined __linux__
                return fdatasync(fileno(stream));
-#else /* !__linux__ */
+#else /* !__linux__ && !__FreeBSD__ */
 #ifdef F_FULLFSYNC
                /* OS X does not implement fdatasync(). */
                return fcntl(fileno(stream), F_FULLFSYNC);