mirror of
https://github.com/neovim/neovim.git
synced 2025-09-28 14:08:32 +00:00
os_open: impl mch_open with libuv. ref #133
- use return value instead of open_req.result - libuv uv_fs_open() returns `-errno` instead of always -1 - libuv always sets open_req.result to the return value, _except_ for OOM where it only sets the return value. So always use the return value. - replace calls to mch_open macro. - update call sites expecting -1 error
This commit is contained in:
@@ -1045,7 +1045,7 @@ void u_write_undo(char_u *name, int forceit, buf_T *buf, char_u *hash)
|
||||
if (os_file_exists(file_name)) {
|
||||
if (name == NULL || !forceit) {
|
||||
/* Check we can read it and it's an undo file. */
|
||||
fd = mch_open((char *)file_name, O_RDONLY, 0);
|
||||
fd = os_open((char *)file_name, O_RDONLY, 0);
|
||||
if (fd < 0) {
|
||||
if (name != NULL || p_verbose > 0) {
|
||||
if (name == NULL)
|
||||
@@ -1089,7 +1089,7 @@ void u_write_undo(char_u *name, int forceit, buf_T *buf, char_u *hash)
|
||||
goto theend;
|
||||
}
|
||||
|
||||
fd = mch_open((char *)file_name,
|
||||
fd = os_open((char *)file_name,
|
||||
O_CREAT|O_WRONLY|O_EXCL|O_NOFOLLOW, perm);
|
||||
if (fd < 0) {
|
||||
EMSG2(_(e_not_open), file_name);
|
||||
|
Reference in New Issue
Block a user