mirror of
https://github.com/neovim/neovim.git
synced 2025-09-30 23:18:33 +00:00
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
This commit is contained in:
@@ -229,7 +229,10 @@ int file_fsync(FileDescriptor *const fp)
|
||||
return flush_error;
|
||||
}
|
||||
const int fsync_error = os_fsync(fp->fd);
|
||||
if (fsync_error != UV_EINVAL && fsync_error != UV_EROFS) {
|
||||
if (fsync_error != UV_EINVAL
|
||||
&& fsync_error != UV_EROFS
|
||||
// fsync not supported on this storage.
|
||||
&& fsync_error != UV_ENOTSUP) {
|
||||
return fsync_error;
|
||||
}
|
||||
return 0;
|
||||
|
Reference in New Issue
Block a user