aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/memfile.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2016-01-01 12:13:40 -0500
committerJustin M. Keyes <justinkz@gmail.com>2016-01-01 12:13:40 -0500
commitdf4ac79761162313de4e27a265044125062013cf (patch)
treef29cc5366be73b1ec58e29e0cb50b407b27a1e8c /src/nvim/memfile.c
parenta79ebeeea469958a2f56096dcfc878da7cf790d6 (diff)
parent648aebb8b6dcf28c85477398572e5552062ceb18 (diff)
downloadrneovim-df4ac79761162313de4e27a265044125062013cf.tar.gz
rneovim-df4ac79761162313de4e27a265044125062013cf.tar.bz2
rneovim-df4ac79761162313de4e27a265044125062013cf.zip
Merge pull request #3911 from sethjackson/have-fsync-guard
os_fsync
Diffstat (limited to 'src/nvim/memfile.c')
-rw-r--r--src/nvim/memfile.c24
1 files changed, 2 insertions, 22 deletions
diff --git a/src/nvim/memfile.c b/src/nvim/memfile.c
index 3df4cbc4a3..9f5e4247b5 100644
--- a/src/nvim/memfile.c
+++ b/src/nvim/memfile.c
@@ -460,31 +460,11 @@ int mf_sync(memfile_T *mfp, int flags)
mfp->mf_dirty = false;
if ((flags & MFS_FLUSH) && *p_sws != NUL) {
-#if defined(UNIX)
-# ifdef HAVE_FSYNC
if (STRCMP(p_sws, "fsync") == 0) {
- if (fsync(mfp->mf_fd))
+ if (os_fsync(mfp->mf_fd)) {
status = FAIL;
- } else {
-# endif
- // OpenNT is strictly POSIX (Benzinger).
- // Tandem/Himalaya NSK-OSS doesn't have sync()
-# if defined(__OPENNT) || defined(__TANDEM)
- fflush(NULL);
-# else
- sync();
-# endif
-# ifdef HAVE_FSYNC
+ }
}
-# endif
-#endif
-# ifdef SYNC_DUP_CLOSE
- // Win32 is a bit more work: Duplicate the file handle and close it.
- // This should flush the file to disk.
- int fd;
- if ((fd = dup(mfp->mf_fd)) >= 0)
- close(fd);
-# endif
}
got_int |= got_int_save;