aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/fileio.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2019-02-20 21:52:12 +0100
committerJustin M. Keyes <justinkz@gmail.com>2019-02-21 02:00:51 +0100
commit996916277d9845b61f026c53197880889e5004e2 (patch)
treed9c16d4750dc98b8af6109faf3283e254b6a119f /src/nvim/fileio.c
parentc59aa771a631be53215eaadadfa4589d168a5c2b (diff)
downloadrneovim-996916277d9845b61f026c53197880889e5004e2.tar.gz
rneovim-996916277d9845b61f026c53197880889e5004e2.tar.bz2
rneovim-996916277d9845b61f026c53197880889e5004e2.zip
I/O: ignore ENOTSUP for failed fsync()
Suggested by ZyX in https://github.com/neovim/neovim/issues/6725#issuecomment-312197691 : > There already is an exception if writing to a “device” (e.g. FIFO). > It makes sense to ignore certain errors like ENOTSUP or EOPNOTSUPP > since it is not something we or user can do anything about. ref #6725
Diffstat (limited to 'src/nvim/fileio.c')
-rw-r--r--src/nvim/fileio.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c
index 6356290b9c..ba3625bf95 100644
--- a/src/nvim/fileio.c
+++ b/src/nvim/fileio.c
@@ -3405,7 +3405,9 @@ restore_backup:
// (could be a pipe).
// If the 'fsync' option is FALSE, don't fsync(). Useful for laptops.
int error;
- if (p_fs && (error = os_fsync(fd)) != 0 && !device) {
+ if (p_fs && (error = os_fsync(fd)) != 0 && !device
+ // fsync not supported on this storage.
+ && error != UV_ENOTSUP) {
SET_ERRMSG_ARG(_("E667: Fsync failed: %s"), error);
end = 0;
}