mirror of
https://github.com/neovim/neovim.git
synced 2025-10-01 23:48:32 +00:00
os_nodetype: open fd with O_NONBLOCK (#5515)
Closes #5267 Helped-by: oni-link <knil.ino@gmail.com>
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user