Skip to content

Commit

Permalink
security/wpa_supplicant-devel: Make use of fdatasync(2)
Browse files Browse the repository at this point in the history
FreeBSD has supported fdatasync(2) since FreeBSD 11.1. Prepare for
future use when syncing to planned updates to base.
  • Loading branch information
cschuber committed Jun 14, 2021
1 parent 649e05b commit 5fe9edb
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions security/wpa_supplicant-devel/files/patch-src_utils_os__unix.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
--- src/utils/os_unix.c.orig 2021-06-02 14:11:18.000000000 -0700
+++ src/utils/os_unix.c 2021-06-07 16:07:39.152547000 -0700
@@ -464,9 +464,9 @@
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);

0 comments on commit 5fe9edb

Please sign in to comment.