From 1ff162c0d99c67043e8b10704e2426192e4f2abf Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Fri, 21 Oct 2016 22:03:01 +0200 Subject: os_nodetype: open fd with O_NONBLOCK (#5515) Closes #5267 Helped-by: oni-link --- src/nvim/os/fs.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') 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; -- cgit