Patch 8.2.3509
Problem: Undo file is not synced. (Sami Farin)
Solution: Sync the undo file if 'fsync' is set. (Christian Brabandt,
closes #8879, closes #8920)
Files: runtime/doc/options.txt, src/undo.c
*** ../vim-8.2.3508/runtime/doc/options.txt 2021-09-10 15:58:24.442743070
+0100
--- runtime/doc/options.txt 2021-10-14 17:37:39.970189294 +0100
***************
*** 3599,3606 ****
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.
This option cannot be set from a |modeline| or in the |sandbox|, for
security reasons.
--- 3610,3617 ----
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) and when writing undo files (see |undo-persistence|).
This option cannot be set from a |modeline| or in the |sandbox|, for
security reasons.
*** ../vim-8.2.3508/src/undo.c 2021-07-27 21:00:39.757712371 +0100
--- src/undo.c 2021-10-14 17:46:13.658523779 +0100
***************
*** 1786,1791 ****
--- 1786,1796 ----
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)
*** ../vim-8.2.3508/src/version.c 2021-10-14 16:53:37.417505210 +0100
--- src/version.c 2021-10-14 17:40:33.733106143 +0100
***************
*** 759,760 ****
--- 759,762 ----
{ /* Add new patch number below this line */
+ /**/
+ 3509,
/**/
--
Although the scythe isn't pre-eminent among the weapons of war, anyone who
has been on the wrong end of, say, a peasants' revolt will know that in
skilled hands it is fearsome.
-- (Terry Pratchett, Mort)
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/20211014165301.A6DA2C80053%40moolenaar.net.