mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
os/fileio: Allow certain failures during file_fsync
According to the documentation fsync() may fail with EROFS or EINVAL if “file descriptor is bound to a special file which does not support synchronization” (e.g. /dev/stderr). This condition is completely valid in this case since main point of `file_fsync()` is dumping buffered input.
This commit is contained in:
parent
4a511de881
commit
85e1a56560
@ -153,7 +153,11 @@ int file_fsync(FileDescriptor *const fp)
|
||||
fp->_error = 0;
|
||||
return error;
|
||||
}
|
||||
return os_fsync(fp->fd);
|
||||
const int error = os_fsync(fp->fd);
|
||||
if (error != UV_EINVAL && error != UV_EROFS) {
|
||||
return error;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/// Buffer used for writing
|
||||
|
Loading…
Reference in New Issue
Block a user