diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2014-06-14 13:15:07 -0400 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2014-07-14 09:04:54 -0400 |
commit | 180c84ed378e694ebcd14198a7436e01462d2c4d (patch) | |
tree | 899919991e7586a279d4704e9904afc602544494 /src/nvim/ex_cmds2.c | |
parent | bf6b0e3c0aa34beca13eee898decdf0fcde8b502 (diff) | |
download | rneovim-180c84ed378e694ebcd14198a7436e01462d2c4d.tar.gz rneovim-180c84ed378e694ebcd14198a7436e01462d2c4d.tar.bz2 rneovim-180c84ed378e694ebcd14198a7436e01462d2c4d.zip |
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
Diffstat (limited to 'src/nvim/ex_cmds2.c')
-rw-r--r-- | src/nvim/ex_cmds2.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nvim/ex_cmds2.c b/src/nvim/ex_cmds2.c index 3158eafe65..85a9e9315a 100644 --- a/src/nvim/ex_cmds2.c +++ b/src/nvim/ex_cmds2.c @@ -2372,9 +2372,9 @@ int source_level(void *cookie) */ static FILE *fopen_noinh_readbin(char *filename) { - int fd_tmp = mch_open(filename, O_RDONLY, 0); + int fd_tmp = os_open(filename, O_RDONLY, 0); - if (fd_tmp == -1) + if (fd_tmp < 0) return NULL; # ifdef HAVE_FD_CLOEXEC |