commit | 340dd0fbe462a15a9678cfba02085b4adcc45f02 | [log] [tgz] |
---|---|---|
author | Bram Moolenaar <Bram@vim.org> | Thu Oct 14 17:52:23 2021 +0100 |
committer | Bram Moolenaar <Bram@vim.org> | Thu Oct 14 17:52:23 2021 +0100 |
tree | c306b977fa7adba5010d56cedd4cfc530f77349f | |
parent | 051a8a375f8fb6a931fbc5ccca714a200d9b327f [diff] [blame] |
patch 8.2.3509: undo file is not synced Problem: Undo file is not synced. (Sami Farin) Solution: Sync the undo file if 'fsync' is set. (Christian Brabandt, closes #8879, closes #8920)
diff --git a/src/undo.c b/src/undo.c index 8141301..033fa6e 100644 --- a/src/undo.c +++ b/src/undo.c
@@ -1786,6 +1786,11 @@ 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)