IO: let 'fsync' option control more cases

Vim has the 'swapsync' option which we removed in 62d137ce09.
Instead let 'fsync' control swapfile-fsync.

These cases ALWAYS force fsync (ignoring 'fsync' option):
- Idle (CursorHold).
- Exit caused by deadly signal.
- SIGPWR signal.
- Explicit :preserve command.
This commit is contained in:
Justin M. Keyes
2018-04-21 00:34:13 +02:00
parent a02d22cca8
commit 498731615c
6 changed files with 19 additions and 20 deletions

View File

@@ -145,7 +145,7 @@ static void on_signal(SignalWatcher *handle, int signum, void *data)
case SIGPWR:
// Signal of a power failure(eg batteries low), flush the swap files to
// be safe
ml_sync_all(false, false);
ml_sync_all(false, false, true);
break;
#endif
#ifdef SIGPIPE