0
0
mirror of https://github.com/vim/vim.git synced 2025-10-14 07:04:10 -04:00

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)
This commit is contained in:
Bram Moolenaar
2019-02-14 12:56:36 +01:00
parent 5fd0f5052f
commit a787019518
5 changed files with 28 additions and 6 deletions

View File

@@ -14791,7 +14791,7 @@ f_writefile(typval_T *argvars, typval_T *rettv)
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 @@ f_writefile(typval_T *argvars, typval_T *rettv)
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);
}