mirror of
https://github.com/neovim/neovim.git
synced 2025-09-20 10:18:18 +00:00
vim-patch:8.0.1305: writefile() never calls fsync() #10153
Problem: Writefile() never calls fsync().
Solution: Follow the 'fsync' option with override to enable or disable.
7567d0b115
This commit is contained in:

committed by
Justin M. Keyes

parent
93afb34712
commit
0b4c53fc23
@@ -8958,7 +8958,7 @@ winwidth({nr}) *winwidth()*
|
|||||||
Examples: >
|
Examples: >
|
||||||
:echo "The current window has " . winwidth(0) . " columns."
|
:echo "The current window has " . winwidth(0) . " columns."
|
||||||
:if winwidth(0) <= 50
|
:if winwidth(0) <= 50
|
||||||
: exe "normal 50\<C-W>|"
|
: 50 wincmd |
|
||||||
:endif
|
:endif
|
||||||
< For getting the terminal or screen size, see the 'columns'
|
< For getting the terminal or screen size, see the 'columns'
|
||||||
option.
|
option.
|
||||||
|
@@ -3363,7 +3363,7 @@ restore_backup:
|
|||||||
if (p_fs && (error = os_fsync(fd)) != 0 && !device
|
if (p_fs && (error = os_fsync(fd)) != 0 && !device
|
||||||
// fsync not supported on this storage.
|
// fsync not supported on this storage.
|
||||||
&& error != UV_ENOTSUP) {
|
&& error != UV_ENOTSUP) {
|
||||||
SET_ERRMSG_ARG(_("E667: Fsync failed: %s"), error);
|
SET_ERRMSG_ARG(e_fsync, error);
|
||||||
end = 0;
|
end = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -958,6 +958,7 @@ EXTERN char_u e_streamkey[] INIT(= N_(
|
|||||||
"E5210: dict key '%s' already set for buffered stream in channel %"
|
"E5210: dict key '%s' already set for buffered stream in channel %"
|
||||||
PRIu64));
|
PRIu64));
|
||||||
EXTERN char_u e_libcall[] INIT(= N_("E364: Library call failed for \"%s()\""));
|
EXTERN char_u e_libcall[] INIT(= N_("E364: Library call failed for \"%s()\""));
|
||||||
|
EXTERN char e_fsync[] INIT(= N_("E667: Fsync failed: %s"));
|
||||||
EXTERN char_u e_mkdir[] INIT(= N_("E739: Cannot create directory %s: %s"));
|
EXTERN char_u e_mkdir[] INIT(= N_("E739: Cannot create directory %s: %s"));
|
||||||
EXTERN char_u e_markinval[] INIT(= N_("E19: Mark has invalid line number"));
|
EXTERN char_u e_markinval[] INIT(= N_("E19: Mark has invalid line number"));
|
||||||
EXTERN char_u e_marknotset[] INIT(= N_("E20: Mark not set"));
|
EXTERN char_u e_marknotset[] INIT(= N_("E20: Mark not set"));
|
||||||
|
@@ -167,3 +167,10 @@ func Test_writefile_sync_dev_stdout()
|
|||||||
throw 'Skipped: /dev/stdout is not writable'
|
throw 'Skipped: /dev/stdout is not writable'
|
||||||
endif
|
endif
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_writefile_sync_arg()
|
||||||
|
" This doesn't check if fsync() works, only that the argument is accepted.
|
||||||
|
call writefile(['one'], 'Xtest', 's')
|
||||||
|
call writefile(['two'], 'Xtest', 'S')
|
||||||
|
call delete('Xtest')
|
||||||
|
endfunc
|
||||||
|
Reference in New Issue
Block a user