diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2016-10-21 22:03:01 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-21 22:03:01 +0200 |
commit | 1ff162c0d99c67043e8b10704e2426192e4f2abf (patch) | |
tree | 237254885da93f3ab6089ca63e03047071e99c65 /src | |
parent | 82f30bfeda2f291d3b2f3d8fee79dd9ace42a9aa (diff) | |
download | rneovim-1ff162c0d99c67043e8b10704e2426192e4f2abf.tar.gz rneovim-1ff162c0d99c67043e8b10704e2426192e4f2abf.tar.bz2 rneovim-1ff162c0d99c67043e8b10704e2426192e4f2abf.zip |
os_nodetype: open fd with O_NONBLOCK (#5515)
Closes #5267
Helped-by: oni-link <knil.ino@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/os/fs.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/nvim/os/fs.c b/src/nvim/os/fs.c index 008952fa97..3c821936e9 100644 --- a/src/nvim/os/fs.c +++ b/src/nvim/os/fs.c @@ -163,8 +163,12 @@ int os_nodetype(const char *name) // saves us the hassle. int nodetype = NODE_WRITABLE; - int fd = os_open(name, O_RDONLY, 0); - switch(uv_guess_handle(fd)) { + int fd = os_open(name, O_RDONLY +#ifdef O_NONBLOCK + | O_NONBLOCK +#endif + , 0); + switch (uv_guess_handle(fd)) { case UV_TTY: // FILE_TYPE_CHAR nodetype = NODE_WRITABLE; break; |