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/undo.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/undo.c')
-rw-r--r-- | src/nvim/undo.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nvim/undo.c b/src/nvim/undo.c index cb40878b43..b9f3309cef 100644 --- a/src/nvim/undo.c +++ b/src/nvim/undo.c @@ -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); |