aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2014-06-30 02:23:41 -0400
committerJustin M. Keyes <justinkz@gmail.com>2014-07-14 09:05:52 -0400
commit0ceebc2c913cc497735e001772cb6b395c36cecc (patch)
tree4e06241295ab8e32358a06eff245431daae52d24 /src
parent180c84ed378e694ebcd14198a7436e01462d2c4d (diff)
downloadrneovim-0ceebc2c913cc497735e001772cb6b395c36cecc.tar.gz
rneovim-0ceebc2c913cc497735e001772cb6b395c36cecc.tar.bz2
rneovim-0ceebc2c913cc497735e001772cb6b395c36cecc.zip
os_open: add unit tests
Diffstat (limited to 'src')
-rw-r--r--src/nvim/os/fs.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/nvim/os/fs.c b/src/nvim/os/fs.c
index ff8b8557de..dce95eb3c9 100644
--- a/src/nvim/os/fs.c
+++ b/src/nvim/os/fs.c
@@ -11,7 +11,6 @@
#include "nvim/misc2.h"
#include "nvim/path.h"
#include "nvim/strings.h"
-#include "nvim/log.h"
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "os/fs.c.generated.h"
@@ -156,16 +155,16 @@ static bool is_executable_in_path(const char_u *name)
/// calls (read, write, lseek, fcntl, etc.). If the operation fails, `-errno`
/// is returned, and no file is created or modified.
///
-/// @param flags bitwise OR of flags defined in <fcntl.h>
-/// @param mode permissions for the newly-created file (IGNORED if 'flags' is
-/// not `O_CREAT` or `O_TMPFILE`)
+/// @param flags Bitwise OR of flags defined in <fcntl.h>
+/// @param mode Permissions for the newly-created file (IGNORED if 'flags' is
+/// not `O_CREAT` or `O_TMPFILE`), subject to the current umask
/// @return file descriptor, or negative `errno` on failure
int os_open(const char* path, int flags, int mode)
{
uv_fs_t open_req;
int r = uv_fs_open(uv_default_loop(), &open_req, path, flags, mode, NULL);
uv_fs_req_cleanup(&open_req);
- //`r` is the same as open_req.result, except when OOM. So just use `r`.
+ // r is the same as open_req.result (except for OOM: then only r is set).
return r;
}