diff options
author | James McCoy <jamessan@jamessan.com> | 2017-06-15 12:55:05 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-15 12:55:05 +0000 |
commit | f8e3bc63eff1828103d8f4bd75339d1471a2417f (patch) | |
tree | f0dce219cf8761faf6b3f9279a5522bf44fcf558 /src | |
parent | 8b976c413e949cb00338f0055104488895178f8c (diff) | |
parent | cb75db4c1815324c75b1b402f8410ee3e39ca383 (diff) | |
download | rneovim-f8e3bc63eff1828103d8f4bd75339d1471a2417f.tar.gz rneovim-f8e3bc63eff1828103d8f4bd75339d1471a2417f.tar.bz2 rneovim-f8e3bc63eff1828103d8f4bd75339d1471a2417f.zip |
Merge pull request #6860 from justinmk/coverity
coverity/155509: negative close() arg
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/os/fs.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/nvim/os/fs.c b/src/nvim/os/fs.c index b9a9480cb8..14dacd97c4 100644 --- a/src/nvim/os/fs.c +++ b/src/nvim/os/fs.c @@ -171,6 +171,10 @@ int os_nodetype(const char *name) | O_NONBLOCK #endif , 0); + if (fd == -1) { + return NODE_OTHER; // open() failed. + } + switch (uv_guess_handle(fd)) { case UV_TTY: // FILE_TYPE_CHAR nodetype = NODE_WRITABLE; |