diff options
author | Seth Jackson <sethjackson@gmail.com> | 2015-10-17 01:21:50 +0100 |
---|---|---|
committer | Seth Jackson <sethjackson@gmail.com> | 2016-01-01 00:12:28 -0500 |
commit | 648aebb8b6dcf28c85477398572e5552062ceb18 (patch) | |
tree | 9cc43fcfb7ae66a829eb40f407edf8c1fb822b2f /src/nvim/fileio.c | |
parent | d8a2007d477cea2174e20b49342d5feb0bfdb7ce (diff) | |
download | rneovim-648aebb8b6dcf28c85477398572e5552062ceb18.tar.gz rneovim-648aebb8b6dcf28c85477398572e5552062ceb18.tar.bz2 rneovim-648aebb8b6dcf28c85477398572e5552062ceb18.zip |
Port fsync() to libuv.
Diffstat (limited to 'src/nvim/fileio.c')
-rw-r--r-- | src/nvim/fileio.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c index 1a6c85abaa..58269983c5 100644 --- a/src/nvim/fileio.c +++ b/src/nvim/fileio.c @@ -3368,16 +3368,16 @@ restore_backup: nchars += len; } -#if defined(UNIX) && defined(HAVE_FSYNC) - /* On many journalling file systems there is a bug that causes both the - * original and the backup file to be lost when halting the system right - * after writing the file. That's because only the meta-data is - * journalled. Syncing the file slows down the system, but assures it has - * been written to disk and we don't lose it. - * For a device do try the fsync() but don't complain if it does not work - * (could be a pipe). - * If the 'fsync' option is FALSE, don't fsync(). Useful for laptops. */ - if (p_fs && fsync(fd) != 0 && !device) { +#if defined(UNIX) + // On many journalling file systems there is a bug that causes both the + // original and the backup file to be lost when halting the system right + // after writing the file. That's because only the meta-data is + // journalled. Syncing the file slows down the system, but assures it has + // been written to disk and we don't lose it. + // For a device do try the fsync() but don't complain if it does not work + // (could be a pipe). + // If the 'fsync' option is FALSE, don't fsync(). Useful for laptops. + if (p_fs && os_fsync(fd) != 0 && !device) { errmsg = (char_u *)_("E667: Fsync failed"); end = 0; } |