Problem: Undo file is not synced. (Sami Farin)
Solution: Sync the undo file if 'fsync' is set. (Christian Brabandt,
closes #8879, closes #8920)
systems without an fsync() implementation, this variable is always
off.
Also see 'swapsync' for controlling fsync() on swap files.
- 'fsync' also applies to |writefile()|, unless a flag is used to
- overrule it.
+ 'fsync' also applies to |writefile()| (unless a flag is used to
+ overrule it) and when writing undo files (see |undo-persistence|).
This option cannot be set from a |modeline| or in the |sandbox|, for
security reasons.
write_ok = FALSE;
#endif
+#if defined(UNIX) && defined(HAVE_FSYNC)
+ if (p_fs && fflush(fp) == 0 && vim_fsync(fd) != 0)
+ write_ok = FALSE;
+#endif
+
write_error:
fclose(fp);
if (!write_ok)
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 3509,
/**/
3508,
/**/