From: Cy Schubert Date: Tue, 8 Jun 2021 03:33:20 +0000 (-0700) Subject: utils: FreeBSD supports fdatasync(2) X-Git-Tag: hostap_2_10~196 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=362d9a49d4e10ee1f40eacae92c97835000f3d45;p=thirdparty%2Fhostap.git utils: FreeBSD supports fdatasync(2) FreeBSD supports fdatasync(2). Enable it in os_unix.c. Signed-off-by: Cy Schubert --- diff --git a/src/utils/os_unix.c b/src/utils/os_unix.c index 1de37204d..258deef9d 100644 --- a/src/utils/os_unix.c +++ b/src/utils/os_unix.c @@ -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);