mirror of
https://github.com/neovim/neovim.git
synced 2025-09-12 22:38:16 +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:
@@ -8317,7 +8317,7 @@ static void f_filereadable(typval_T *argvars, typval_T *rettv)
|
||||
# define O_NONBLOCK 0
|
||||
#endif
|
||||
p = get_tv_string(&argvars[0]);
|
||||
if (*p && !os_isdir(p) && (fd = mch_open((char *)p,
|
||||
if (*p && !os_isdir(p) && (fd = os_open((char *)p,
|
||||
O_RDONLY | O_NONBLOCK, 0)) >= 0) {
|
||||
n = TRUE;
|
||||
close(fd);
|
||||
|
Reference in New Issue
Block a user