patch 8.1.0915: fsync() may not work properly on Mac
Problem: fsync() may not work properly on Mac.
Solution: Use fcntl() with F_FULLFSYNC. (suggested by Justin M. Keyes)
diff --git a/src/evalfunc.c b/src/evalfunc.c
index 6538b36..e693ef9 100644
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -14791,7 +14791,7 @@
else if (do_fsync)
// Ignore the error, the user wouldn't know what to do about it.
// May happen for a device.
- vim_ignored = fsync(fileno(fd));
+ vim_ignored = vim_fsync(fileno(fd));
#endif
fclose(fd);
}
@@ -14803,7 +14803,7 @@
else if (do_fsync)
/* Ignore the error, the user wouldn't know what to do about it.
* May happen for a device. */
- vim_ignored = fsync(fileno(fd));
+ vim_ignored = vim_fsync(fileno(fd));
#endif
fclose(fd);
}